合并分支 'akun' 到 'master'
Akun 查看合并请求 !326
正在显示
1 个修改的文件
包含
8 行增加
和
4 行删除
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Aside\Com; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Aside\Com; | ||
| 12 | use App\Helper\Common; | 12 | use App\Helper\Common; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Models\Com\UpdateLog; | 14 | use App\Models\Com\UpdateLog; |
| 15 | +use App\Models\Domain\DomainInfo; | ||
| 15 | use App\Models\Project\ProjectUpdateTdk; | 16 | use App\Models\Project\ProjectUpdateTdk; |
| 16 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 17 | use Illuminate\Support\Facades\DB; | 18 | use Illuminate\Support\Facades\DB; |
| @@ -66,7 +67,7 @@ class UpdateController extends BaseController | @@ -66,7 +67,7 @@ class UpdateController extends BaseController | ||
| 66 | 67 | ||
| 67 | $project = ProjectServer::useProject($this->param['project_id']); | 68 | $project = ProjectServer::useProject($this->param['project_id']); |
| 68 | 69 | ||
| 69 | - if(!$project){ | 70 | + if (!$project) { |
| 70 | $this->fail('项目不存在'); | 71 | $this->fail('项目不存在'); |
| 71 | } | 72 | } |
| 72 | 73 | ||
| @@ -86,10 +87,13 @@ class UpdateController extends BaseController | @@ -86,10 +87,13 @@ class UpdateController extends BaseController | ||
| 86 | //关闭数据库 | 87 | //关闭数据库 |
| 87 | DB::disconnect('custom_mysql'); | 88 | DB::disconnect('custom_mysql'); |
| 88 | 89 | ||
| 90 | + //查看项目是否已上线 | ||
| 91 | + $domain_info = DomainInfo::where('project_id', $this->param['project_id'])->first(); | ||
| 92 | + | ||
| 89 | $update = ['collect_status' => 0]; | 93 | $update = ['collect_status' => 0]; |
| 90 | -// if ($this->param['type'] == 2) { | ||
| 91 | -// $update['status'] = 0; | ||
| 92 | -// } | 94 | + if ($this->param['type'] == 2 && !$domain_info) { |
| 95 | + $update['status'] = 0; | ||
| 96 | + } | ||
| 93 | 97 | ||
| 94 | UpdateLog::where('project_id', $this->param['project_id'])->whereIn('api_type', ['post', 'page', 'news', 'blog'])->update($update); | 98 | UpdateLog::where('project_id', $this->param['project_id'])->whereIn('api_type', ['post', 'page', 'news', 'blog'])->update($update); |
| 95 | 99 |
-
请 注册 或 登录 后发表评论