where($map)->orderBy('id','asc')->get()->toArray(); //dd($list); if(!empty($list)){ foreach($list as $key => $val){ $msg_id = $val->id; dispatch((new TypingJob($msg_id))->delay(0));//加入队列 } //更新 $ids = array_column($list,'id'); $update = [ 'plantask_status' => 1, ]; DB::table('mt_gift_user_typing')->whereIn('id',$ids)->update($update); } return 0; } }