db = Db::connect('mysql0'); $this->client = new Client(); $this->curl = new Curl(); } public function getChauffeurData() { $this->db->table('taxi_chauffeur_copy1') ->field('chauffeurid,card_num,areacode,fullname,is_test') ->chunk(100,function ($list){ foreach ($list as $item){ $this->updateIsLegitimate($item['chauffeurid']); } }); } public function updateIsLegitimate($id) { $data = $this->db->table('taxi_chauffeur_copy1') ->where('chauffeurid','=',$id) ->update(['is_test'=>0]); return $data; } }