mobile = $array['mobile']; $this->message = $array['message']; } /** * Execute the job. * * @return void */ public function handle() { $mobile_list = implode(',', $this->mobile); $result = Messenger::sendSmsBatch($mobile_list, $this->message,$this->mobile); if($result['code']){ foreach ($this->mobile as $mobile){ // $user = User::where('mobile',$mobile)->first(); // $user->addSuperRank($day=0, $month=3, $type='support_henan'); $arr = [ 'phone' => $mobile, 'message' => $this->message, 'confirmed' => 1, 'ip' => '127.0.0.1', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), ]; $insert[] = $arr; } if(!empty($insert)){ Message::insert($insert); } } } }