table = $table; } public function handle() { info(__CLASS__.' 开始处理 '.$this->table); $count = (new Log())->setTable($this->table) ->whereNull('coupon_no') ->where('path', 'http://api.pingan.com.cn/open/vassPartner/appsvr/property/api/new/partner/redemption') ->where('out_source->code', 200) ->count(); if ($count > 0) { (new Log())->setTable($this->table) ->whereNull('coupon_no') ->where('path', 'http://api.pingan.com.cn/open/vassPartner/appsvr/property/api/new/partner/redemption') ->where('out_source->code', 200) ->chunkById(1000, function ($logs) { foreach ($logs as $log) { $data = (new Verification())->decrypt($log->in_source['json']['data']); $data = json_decode($data, true); $log->update([ 'coupon_no' => $data['couponNo'] ]); } }); } info(__CLASS__.' '.$this->table.' 成功处理 '.$count); } }