正在显示
1 个修改的文件
包含
4 行增加
和
5 行删除
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | * @remark : | 3 | * @remark : |
| 4 | - * @name :SyncManager.php | 4 | + * @name :SyncMobile.php |
| 5 | * @author :lyh | 5 | * @author :lyh |
| 6 | * @method :post | 6 | * @method :post |
| 7 | * @time :2023/12/25 15:00 | 7 | * @time :2023/12/25 15:00 |
| @@ -10,11 +10,10 @@ | @@ -10,11 +10,10 @@ | ||
| 10 | namespace App\Console\Commands; | 10 | namespace App\Console\Commands; |
| 11 | 11 | ||
| 12 | use App\Models\User\User; | 12 | use App\Models\User\User; |
| 13 | -use App\Services\ProjectServer; | ||
| 14 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| 15 | use Illuminate\Support\Facades\DB; | 14 | use Illuminate\Support\Facades\DB; |
| 16 | 15 | ||
| 17 | -class SyncManager extends Command | 16 | +class SyncMobile extends Command |
| 18 | { | 17 | { |
| 19 | /** | 18 | /** |
| 20 | * The name and signature of the console command. | 19 | * The name and signature of the console command. |
| @@ -40,7 +39,7 @@ class SyncManager extends Command | @@ -40,7 +39,7 @@ class SyncManager extends Command | ||
| 40 | public function handle(){ | 39 | public function handle(){ |
| 41 | $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php'; | 40 | $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php'; |
| 42 | $data = curlGet($url);//TODO::获取号码库 | 41 | $data = curlGet($url);//TODO::获取号码库 |
| 43 | - DB::connection('gl_mobile')->delete(); | 42 | + DB::table('gl_mobile')->delete(); |
| 44 | $param = []; | 43 | $param = []; |
| 45 | $create_time = date('Y-m-d H:i:s'); | 44 | $create_time = date('Y-m-d H:i:s'); |
| 46 | foreach ($data as $v){ | 45 | foreach ($data as $v){ |
| @@ -48,7 +47,7 @@ class SyncManager extends Command | @@ -48,7 +47,7 @@ class SyncManager extends Command | ||
| 48 | $param['created_at'] = $create_time; | 47 | $param['created_at'] = $create_time; |
| 49 | } | 48 | } |
| 50 | if(!empty($param)){ | 49 | if(!empty($param)){ |
| 51 | - DB::connection('gl_mobile')->insert($param); | 50 | + DB::table('gl_mobile')->insert($param); |
| 52 | $userModel = new User(); | 51 | $userModel = new User(); |
| 53 | try { | 52 | try { |
| 54 | $userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]); | 53 | $userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]); |
-
请 注册 或 登录 后发表评论