|
...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
|
namespace App\Http\Controllers\Aside\Project;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\QuanqiusouApi;
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\Manage\ManageLogic;
|
|
|
|
use App\Http\Logic\Aside\Project\OnlineCheckLogic;
|
|
...
|
...
|
@@ -15,6 +16,7 @@ use App\Models\Channel\Channel; |
|
|
|
use App\Models\Com\City;
|
|
|
|
use App\Models\Devops\ServerConfig;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\HomeCount\Count;
|
|
|
|
use App\Models\Inquiry\InquirySet;
|
|
|
|
use App\Models\Manage\BelongingGroup;
|
|
|
|
use App\Models\Manage\Manage;
|
|
...
|
...
|
@@ -25,6 +27,7 @@ use App\Models\Project\Payment; |
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\RankData\RankData;
|
|
|
|
use App\Models\Task\Task;
|
|
|
|
use App\Models\Visit\Visit;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
...
|
...
|
@@ -571,17 +574,44 @@ class ProjectController extends BaseController |
|
|
|
public function getProjectByChannel(){
|
|
|
|
$source_id = $this->param['channel_id']; //原系统渠道id
|
|
|
|
$size = $this->param['page_size'] ?? 20;
|
|
|
|
$type = $this->param['type'];
|
|
|
|
$type = $this->param['type'] ?? '';
|
|
|
|
$company = $this->param['company'] ?? '';
|
|
|
|
$channel = Channel::where('source_id', $source_id)->first();
|
|
|
|
if(!$channel){
|
|
|
|
$this->response('渠道不存在',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
|
|
|
|
$list = Project::where('channel->channel_id', $channel->id)->where(function ($query) use ($type){
|
|
|
|
if($type){
|
|
|
|
$data = Project::with(['deploy_build', 'deploy_optimize', 'online_check'])->where('channel->channel_id', $channel->id)->where(function ($query) use ($type, $company){
|
|
|
|
if ($type) {
|
|
|
|
$query->where('type', $type);
|
|
|
|
}
|
|
|
|
})->orderBy('id', 'desc')->paginate($size);
|
|
|
|
$this->response('success',Code::SUCCESS, $list);
|
|
|
|
if ($company) {
|
|
|
|
$query->where('company', 'like', '%' . $company . '%');
|
|
|
|
}
|
|
|
|
})->orderBy('id', 'desc')->paginate($size)->toArray();
|
|
|
|
foreach ($data['list'] as $item){
|
|
|
|
$item['type_text'] = Project::typeMap()[$item['type']] ?? '';
|
|
|
|
$item['plan_text'] = Project::planMap()[$item['deploy_build']['plan']] ?? '';
|
|
|
|
$item['start_date'] = $item['deploy_optimize']['start_date'] ?? '';
|
|
|
|
$item['domain'] = $item['deploy_optimize']['domain'] ?? '';
|
|
|
|
$item['test_domain'] = $item['deploy_build']['test_domain'] ?? '';
|
|
|
|
$item['online_time'] = $item['online_check']['qa_check_time'] ?? '';
|
|
|
|
if ($item['type'] == 3) {
|
|
|
|
$item['is_compliance'] = RankData::where('project_id', $item['id'])->where('lang', '')->value('is_compliance') ?: 0;
|
|
|
|
} else {
|
|
|
|
$item['is_compliance'] = 1;
|
|
|
|
}
|
|
|
|
$yesterday_count = Count::where('project_id', $item['id'])->where('date', date('Y-m-d', strtotime('-1 day')))->first();
|
|
|
|
$today_count = Count::where('project_id', $item['id'])->where('date', date('Y-m-d'))->first();
|
|
|
|
$item['yesterday_ip_count'] = $yesterday_count['ip_num'] ?? 0;
|
|
|
|
$item['to_ip_count'] = $today_count['ip_num'] ?? 0;
|
|
|
|
$item['inquiry_num'] = $today_count['inquiry_num'] ?? 0;
|
|
|
|
|
|
|
|
unset($item['deploy_build']);
|
|
|
|
unset($item['deploy_optimize']);
|
|
|
|
unset($item['online_check']);
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->response('success',Code::SUCCESS, $data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|