正在显示
1 个修改的文件
包含
55 行增加
和
0 行删除
app/Console/Commands/SyncManager.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :SyncManager.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2023/12/25 15:00 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands; | ||
| 11 | + | ||
| 12 | +use App\Models\User\User; | ||
| 13 | +use App\Services\ProjectServer; | ||
| 14 | +use Illuminate\Console\Command; | ||
| 15 | +use Illuminate\Support\Facades\DB; | ||
| 16 | + | ||
| 17 | +class SyncManager extends Command | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * The name and signature of the console command. | ||
| 21 | + * | ||
| 22 | + * @var string | ||
| 23 | + */ | ||
| 24 | + protected $signature = 'sync_manager'; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * The console command description. | ||
| 28 | + * | ||
| 29 | + * @var string | ||
| 30 | + */ | ||
| 31 | + protected $description = '同步手机号码库'; | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * @remark :统一更新路由 | ||
| 35 | + * @name :handle | ||
| 36 | + * @author :lyh | ||
| 37 | + * @method :post | ||
| 38 | + * @time :2023/11/20 15:13 | ||
| 39 | + */ | ||
| 40 | + public function handle(){ | ||
| 41 | + $url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php'; | ||
| 42 | + $data = curlGet($url);//TODO::获取号码库 | ||
| 43 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND); | ||
| 44 | +// if(!empty($data)){ | ||
| 45 | +// $userModel = new User(); | ||
| 46 | +// try { | ||
| 47 | +// $userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]); | ||
| 48 | +// $userModel->edit(['status'=>0],['project_id'=>1,'mobile'=>['in',$data]]); | ||
| 49 | +// }catch (\Exception $e){ | ||
| 50 | +// echo date('Y-m-d H:i:s') . 'error' . PHP_EOL; | ||
| 51 | +// } | ||
| 52 | +// } | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | +} |
-
请 注册 或 登录 后发表评论