1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\admin\model;
- use Curl\Curl;
- use GuzzleHttp\Client;
- use think\facade\Db;
- /**
- * Class TaxiChauffeur
- * @package app\service
- */
- class TaxiChauffeur
- {
- protected $db;
- protected $client;
- protected $curl;
- public $url = 'http://106.37.189.144:8080/staffcert-web/public/queryStaffCertFromTranscert.json';
- public function __construct()
- {
- $this->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;
- }
- }
|