get()->toArray(); // dd($info); foreach ($info as $k) { //图文的更改 if ($k['service_type'] == 1) { $a = Serviceapplys::where('docter_id',$id)->where('service_type',1)->update(['status'=> $chat_num]); if ($chat_num == 3) { Docter::where('id',$id)->update(['is_chat'=>0]); } } //电话的更改 if ($k['service_type'] == 2) { Serviceapplys::where('docter_id',$id)->where('service_type',2)->update(['status'=> $phone_num]); if ($phone_num == 3) { Docter::where('id',$id)->update(['is_phone'=>0]); } } //预约的更改 if ($k['service_type'] == 3) { Serviceapplys::where('docter_id',$id)->where('service_type',3)->update(['status'=> $appoint_num]); if ($appoint_num == 3) { Docter::where('id',$id)->update(['is_appoint'=>0]); } } } return redirect('/admin/docters_service?id='.$id.''); } }