<?php namespace Api\Api;
use Dever;
class Task
{
    # 定时更新
    public function func()
    {
        $where['status'] = 1;
        $where['cron_time'] = array('>', '0');
        $data = Dever::db('app_func', 'api')->select($where);
        if ($data) {
            foreach ($data as $k => $v) {
                $account = Dever::db('account', 'api')->find(array('app_id' => $v['app_id']));
                if ($account) {
                    Dever::load('account', 'api')->run($account, $v);
                }
            }
        }
    }
}
