作者 lyh

gx

... ... @@ -3,17 +3,13 @@
namespace App\Console\Commands;
use App\Helper\OaGlobalsoApi;
use App\Http\Logic\Aside\Project\PaymentLogic;
use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Models\Channel\Channel;
use App\Models\NoticeLog;
use App\Models\Project\DeployBuild;
use App\Models\Project\Payment;
use App\Models\Project\Project;
use App\Models\Project\ProjectRenew;
use App\Utils\LogUtils;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
/**
* 同步项目信息
... ...
... ... @@ -10,6 +10,8 @@ use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Http\Requests\Aside\Project\ProcessRecordsRequest;
use App\Http\Requests\Aside\Project\ProjectRequest;
use App\Models\City;
use App\Models\Devops\ServerConfig;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquirySet;
use App\Models\Manage\BelongingGroup;
use App\Models\Manage\ManageHr;
... ... @@ -266,4 +268,35 @@ class ProjectController extends BaseController
$lists = $hrManagerModel->list($this->map,'id',['id','manage_id','name','entry_position','is_leader']);
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取项目服务器与数据库列表
* @name :getServiceConfig
* @author :lyh
* @method :post
* @time :2023/8/14 10:23
*/
public function getServiceConfig(){
$this->request->validate([
'type'=>'required',
],[
'type.required' => '请选择审核类型'
]);
$serviceConfigModel = new ServerConfig();
$list = $serviceConfigModel->list($this->param);
$this->response('success',Code::SUCCESS,$list);
}
/**
* @remark :获取域名列表
* @name :getDomain
* @author :lyh
* @method :post
* @time :2023/8/14 10:29
*/
public function getDomain(){
$domainModel = new DomainInfo();
$list = $domainModel->list(['status'=>0]);
$this->response('success',Code::SUCCESS,$list);
}
}
... ...
... ... @@ -3,7 +3,7 @@
namespace App\Http\Logic\Aside\Optimize;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Project\DomainInfo;
use App\Models\Domain\DomainInfo;
use App\Models\Project\Gsc;
class GscLogic extends BaseLogic
... ...
... ... @@ -3,8 +3,8 @@
namespace App\Http\Logic\Aside\Optimize;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Domain\DomainInfo;
use App\Models\Project\DeployOptimize;
use App\Models\Project\DomainInfo;
/**
* @remark :优化授权域名
... ...
<?php
namespace App\Http\Logic\Aside\Project;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Project\DomainInfo;
use App\Models\Project\Payment;
use MongoDB\Client;
class DomainInfoLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new DomainInfo();
}
public function getDomainInfo($project_id)
{
$project = app(ProjectLogic::class)->getInfo($project_id);
$domain = $project['deploy_optimize']['domain'] ?? '';
$info = $this->model->where('project_id', $project_id)->first();
//不存在或时间过期了 重新获取信息
$expiration_date = $info['domain_info']['expiration_date'] ?? '';
$end_time = $info['ssl']['end_time'] ?? '';
if(!$info || $expiration_date < date("Y-m-d") || $end_time < date('Y-m-d')){
try {
$mongo = new Client("mongodb://root:globalso8837840@23.228.125.2:27017");
$db = $mongo->globalso_monitor;
$collection = $db->project_v1;
$project_zk = $collection->findOne(['main_url' => $domain]);
$info['domain'] = $domain;
$info['domain_info'] = (array) $project_zk['domain_info'] ?? [];
$info['ssl'] = (array) $project_zk['ssl'] ?? [];
parent::save($info);
}catch (\Exception $e){
return [];
}
}
return $info;
}
}
... ... @@ -33,7 +33,6 @@ class RankDataLogic extends BaseLogic
//查数据
$project = (new ProjectLogic())->getInfo($project_id);
$domain_info = (new DomainInfoLogic)->getDomainInfo($project_id);
$rank = RankData::where('project_id', $project_id)->first();
$rank_week = RankWeek::where('project_id', $project_id)->first();
$recomm_domain = RecommDomain::where('project_id', $project_id)->first();
... ... @@ -56,8 +55,6 @@ class RankDataLogic extends BaseLogic
$data['project'] = [
'company' => $project['company'],
'domain' => $project['deploy_optimize']['domain'] ?? '',
'domain_info' => ($domain_info['domain_info']['creation_date'] ?? '') . ' - ' . ($domain_info['domain_info']['expiration_date'] ?? ''),
'cert_info' => ($domain_info['ssl']['start_time'] ?? '') . ' - ' . ($domain_info['ssl']['end_time'] ?? ''),
'plan' => str_replace('营销大师-', '全球搜-', $project['deploy_build']['plan'][0] ?? ''),
'keyword_num' => $project['deploy_build']['keyword_num'],
'compliance_day' => $rank['compliance_day'] ?? 0,
... ...
... ... @@ -149,6 +149,8 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/online_check', [Aside\Project\ProjectController::class, 'online_check'])->name('admin.project_online_check');
Route::any('/getBelongingGroup', [Aside\Project\ProjectController::class, 'getBelongingGroup'])->name('admin.project_getBelongingGroup');//获取组
Route::any('/getManagerList', [Aside\Project\ProjectController::class, 'getManagerList'])->name('admin.project_getManagerList');//根据组获取用户
Route::any('/getServiceConfig', [Aside\Project\ProjectController::class, 'getServiceConfig'])->name('admin.project_getServiceConfig');//获取数据库和服务器
Route::any('/getServiceConfig', [Aside\Project\ProjectController::class, 'getServiceConfig'])->name('admin.project_getServiceConfig');//获取域名列表
});
//续费
Route::prefix('renew')->group(function () {
... ...