$id])->first(); if(empty($user)){continue;} $user_arr = []; //echo '用户id:'.$id.' 角色'.$user->role.PHP_EOL; if(!in_array($user->role,$user_arr)){ $user_arr[] = $user->role; } DeliverInfo::where(['user_id'=>$id])->delete(); AccountInfo::where(['user_id'=>$id])->delete(); RechargeInfo::where(['user_id'=>$id])->delete(); $data['account']=0; if($user->role == 2){ $data['agent_account'] = 0; } UserInfo::where(['id'=>$id])->update($data); } } }