|

楼主 |
发表于 2018-12-28 16:08:29
|
显示全部楼层
本帖最后由 sszwei 于 2018-12-28 16:09 编辑
PHP复制代码 class Cron extends CI_Controller
{
public function colonelIncome ($code)
{
if(is_cli ()):
$time = time();
$newIDs = $newResult = [];
$sql = "SELECT `id`, `uid`, `number`, `value` FROM `a` WHERE (`time` + 7 * 86400) < ". time()." AND `status` = 0 LIMIT 1000 "; /*超过7天*/
$query = $this->db->query($sql);
$result = $query->result();
if( $result != NULL ):
foreach ($result as $val): $newIDs[] = $val; $newResult[] = $val;
endforeach;
endif;
if( ! empty($newIDs) AND ! empty($newResult) ):
$data = [
'status' => 1,
];
$this->db->where_in('id', $newIDs);
$this->db->update('a', $data);
$this->db->insert_batch('b', $newResult);
endif;
log_message ('debug', 'Model:colonelIncome arams:'.implode('-', $newIDs));
echo 'Colonel_Income Table Status 1 OK';exit;
else:
echo 'x';exit;
endif;
}
}
复制代码
执行OK,就是config读取不了production的配置,别的功能就OK。。能做到覆盖读取

|
|