作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !355
... ... @@ -9,7 +9,6 @@
namespace App\Http\Controllers\Aside\Com;
use App\Helper\Common;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Com\UpdateLog;
use App\Models\Com\UpdateOldInfo;
... ... @@ -17,7 +16,6 @@ use App\Models\Domain\DomainInfo;
use App\Models\Project\ProjectUpdateTdk;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
/**
* @remark :b端网站更新相关
... ... @@ -105,12 +103,23 @@ class UpdateController extends BaseController
//关闭数据库
DB::disconnect('custom_mysql');
$update = ['collect_status' => 0];
if ($this->param['type'] == 2 && !$domain_info) {
$update['status'] = 0;
if ($domain_info) {
$old_info = UpdateOldInfo::where('project_id', $this->param['project_id'])->first();
if (!$old_info) {
$old_info = new UpdateOldInfo();
$old_info->project_id = $this->param['project_id'];
$old_info->link_type = 0;
$old_info->old_domain_online = $domain_info->domain;
}
$old_info->old_domain_test = $test_domain;
$old_info->save();
}
UpdateLog::where('project_id', $this->param['project_id'])->whereIn('api_type', ['post', 'page', 'news', 'blog'])->update($update);
UpdateLog::where('project_id', $this->param['project_id'])->whereNotIn('api_type', ['category', 'category_news', 'website_info', 'tag'])->update(['collect_status' => 0]);
if ($this->param['type'] == 2 && !$domain_info) {
UpdateLog::where('project_id', $this->param['project_id'])->whereNotIn('api_type', ['category', 'category_news'])->update(['status' => 0]);
}
$this->response('采集任务添加成功');
}
... ...