正在显示
1 个修改的文件
包含
7 行增加
和
25 行删除
| @@ -5,6 +5,7 @@ namespace App\Console\Commands\Test; | @@ -5,6 +5,7 @@ namespace App\Console\Commands\Test; | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Models\Collect\CollectTask; | 6 | use App\Models\Collect\CollectTask; |
| 7 | use App\Models\Com\UpdateLog; | 7 | use App\Models\Com\UpdateLog; |
| 8 | +use App\Models\Com\UpdateVisit; | ||
| 8 | use App\Models\Product\Product; | 9 | use App\Models\Product\Product; |
| 9 | use App\Services\ProjectServer; | 10 | use App\Services\ProjectServer; |
| 10 | use Illuminate\Console\Command; | 11 | use Illuminate\Console\Command; |
| @@ -29,31 +30,12 @@ class Temp extends Command | @@ -29,31 +30,12 @@ class Temp extends Command | ||
| 29 | 30 | ||
| 30 | public function handle() | 31 | public function handle() |
| 31 | { | 32 | { |
| 32 | - $data_project = [162]; | ||
| 33 | - | ||
| 34 | - foreach ($data_project as $project_id) { | ||
| 35 | - $project = ProjectServer::useProject($project_id); | ||
| 36 | - if ($project) { | ||
| 37 | - $list = Product::get(); | ||
| 38 | - foreach ($list as $item) { | ||
| 39 | - $seo = $item->seo_mate; | ||
| 40 | - if ($seo) { | ||
| 41 | - $seo['title'] = substr(strip_tags($seo['title']??''), 0, 70); | ||
| 42 | - $seo['keyword'] = substr(strip_tags($seo['keyword']??''), 0, 255); | ||
| 43 | - $seo['description'] = substr(strip_tags($seo['description']??''), 0, 200); | ||
| 44 | - $item->seo_mate = Arr::a2s($seo); | ||
| 45 | - try { | ||
| 46 | - $item->save(); | ||
| 47 | - }catch (\Exception $e){ | ||
| 48 | - continue; | ||
| 49 | - } | ||
| 50 | - } | ||
| 51 | - } | ||
| 52 | - } | ||
| 53 | - //关闭数据库 | ||
| 54 | - DB::disconnect('custom_mysql'); | ||
| 55 | - | ||
| 56 | - echo $project_id . '成功, product' . PHP_EOL; | 33 | + $data = UpdateLog::where('api_type','website_info')->get(); |
| 34 | + | ||
| 35 | + foreach ($data as $item) { | ||
| 36 | + UpdateVisit::createLog($item->project_id,$item->api_url); | ||
| 37 | + | ||
| 38 | + echo $item->project_id . '成功' . PHP_EOL; | ||
| 57 | } | 39 | } |
| 58 | } | 40 | } |
| 59 | } | 41 | } |
-
请 注册 或 登录 后发表评论