正在显示
1 个修改的文件
包含
15 行增加
和
6 行删除
| @@ -9,7 +9,6 @@ | @@ -9,7 +9,6 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Http\Controllers\Aside\Com; | 10 | namespace App\Http\Controllers\Aside\Com; |
| 11 | 11 | ||
| 12 | -use App\Helper\Common; | ||
| 13 | use App\Http\Controllers\Bside\BaseController; | 12 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Models\Com\UpdateLog; | 13 | use App\Models\Com\UpdateLog; |
| 15 | use App\Models\Com\UpdateOldInfo; | 14 | use App\Models\Com\UpdateOldInfo; |
| @@ -17,7 +16,6 @@ use App\Models\Domain\DomainInfo; | @@ -17,7 +16,6 @@ use App\Models\Domain\DomainInfo; | ||
| 17 | use App\Models\Project\ProjectUpdateTdk; | 16 | use App\Models\Project\ProjectUpdateTdk; |
| 18 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 19 | use Illuminate\Support\Facades\DB; | 18 | use Illuminate\Support\Facades\DB; |
| 20 | -use Illuminate\Support\Facades\Redis; | ||
| 21 | 19 | ||
| 22 | /** | 20 | /** |
| 23 | * @remark :b端网站更新相关 | 21 | * @remark :b端网站更新相关 |
| @@ -105,12 +103,23 @@ class UpdateController extends BaseController | @@ -105,12 +103,23 @@ class UpdateController extends BaseController | ||
| 105 | //关闭数据库 | 103 | //关闭数据库 |
| 106 | DB::disconnect('custom_mysql'); | 104 | DB::disconnect('custom_mysql'); |
| 107 | 105 | ||
| 108 | - $update = ['collect_status' => 0]; | ||
| 109 | - if ($this->param['type'] == 2 && !$domain_info) { | ||
| 110 | - $update['status'] = 0; | 106 | + if ($domain_info) { |
| 107 | + $old_info = UpdateOldInfo::where('project_id', $this->param['project_id'])->first(); | ||
| 108 | + if (!$old_info) { | ||
| 109 | + $old_info = new UpdateOldInfo(); | ||
| 110 | + $old_info->project_id = $this->param['project_id']; | ||
| 111 | + $old_info->link_type = 0; | ||
| 112 | + $old_info->old_domain_online = $domain_info->domain; | ||
| 113 | + } | ||
| 114 | + $old_info->old_domain_test = $test_domain; | ||
| 115 | + $old_info->save(); | ||
| 111 | } | 116 | } |
| 112 | 117 | ||
| 113 | - UpdateLog::where('project_id', $this->param['project_id'])->whereIn('api_type', ['post', 'page', 'news', 'blog'])->update($update); | 118 | + UpdateLog::where('project_id', $this->param['project_id'])->whereNotIn('api_type', ['category', 'category_news', 'website_info', 'tag'])->update(['collect_status' => 0]); |
| 119 | + | ||
| 120 | + if ($this->param['type'] == 2 && !$domain_info) { | ||
| 121 | + UpdateLog::where('project_id', $this->param['project_id'])->whereNotIn('api_type', ['category', 'category_news'])->update(['status' => 0]); | ||
| 122 | + } | ||
| 114 | 123 | ||
| 115 | $this->response('采集任务添加成功'); | 124 | $this->response('采集任务添加成功'); |
| 116 | } | 125 | } |
-
请 注册 或 登录 后发表评论