* @version : HUOSDK 8.0 */ namespace console\index\controller; use huo\controller\finance\Settle; use think\console\Command; use think\console\Input; use think\console\Output; use think\Db; class ReturnSettle extends Command { protected function configure() { $this->setName('return_settle')->setDescription('返回提现,设置为不通过'); } protected function execute(Input $input, Output $output) { $_sql = "SELECT s.id,s.banknum,s.amount,s.status FROM h_settle s LEFT JOIN h_mem_oauth mo ON s.banknum = mo.openid WHERE mo.conf_id=2 AND s.`status` IN (1,2,6) LIMIT 1000"; $_data = Db::query($_sql); if(empty($_data)){ echo '更新完毕';exit; } $_content = '公众号【火游戏】更换为【口袋爱玩】,请重新关注提现!'; $_status = 5; if (empty($_data)) { echo '更新完毕'; exit; } foreach ($_data as $_v) { if (1 == $_v['status']) { $_status = 4; } (new Settle())->setStatus(1, $_v['id'], $_status, $_content); } echo 'SUCCESS'; } }