正在显示
1 个修改的文件
包含
6 行增加
和
5 行删除
| @@ -40,14 +40,15 @@ class SyncMobile extends Command | @@ -40,14 +40,15 @@ class SyncMobile extends Command | ||
| 40 | $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php'; | 40 | $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php'; |
| 41 | $data = curlGet($url);//TODO::获取号码库 | 41 | $data = curlGet($url);//TODO::获取号码库 |
| 42 | DB::table('gl_mobile')->delete(); | 42 | DB::table('gl_mobile')->delete(); |
| 43 | - $param = []; | ||
| 44 | $create_time = date('Y-m-d H:i:s'); | 43 | $create_time = date('Y-m-d H:i:s'); |
| 45 | foreach ($data as $v){ | 44 | foreach ($data as $v){ |
| 46 | - $param[]['mobile'] = $v; | ||
| 47 | - $param[]['created_at'] = $create_time; | ||
| 48 | - } | ||
| 49 | - if(!empty($param)){ | 45 | + $param = [ |
| 46 | + 'mobile'=>$v, | ||
| 47 | + 'created_at'=>$create_time | ||
| 48 | + ]; | ||
| 50 | DB::table('gl_mobile')->insert($param); | 49 | DB::table('gl_mobile')->insert($param); |
| 50 | + } | ||
| 51 | + if(!empty($data)){ | ||
| 51 | $userModel = new User(); | 52 | $userModel = new User(); |
| 52 | try { | 53 | try { |
| 53 | $userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]); | 54 | $userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]); |
-
请 注册 或 登录 后发表评论