作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -122,7 +122,7 @@ class AiBlogAuthorId extends Command
if($servers_id == ServerConfig::SELF_SITE_ID){
//自建站服务器:如果项目已经上线,不请求C端接口,数据直接入库
$domain_model = new DomainInfo();
$domain_info = $domain_model->read(['project_id'=>$this->user['project_id']],['domain']);
$domain_info = $domain_model->read(['project_id'=>$project_id],['domain']);
if($domain_info){
//判断是否已有更新进行中
$notify_model = new Notify();
... ...
... ... @@ -60,7 +60,7 @@ class AiBlogAutoPublish extends Command
public function auto_publish()
{
$this->output('开始自动发布博客文章');
$projects = Project::where('is_ai_blog', 1)->where('delete_status',0)->where('site_status',0)->where('extend_type',0)->get();
$projects = Project::where('is_ai_blog', 1)->whereIn('type',[1,2,3,4,6])->where('delete_status',0)->where('site_status',0)->where('extend_type',0)->get();
foreach ($projects as $project) {
try {
$this->output("项目{$project->id}开始自动发布");
... ...
... ... @@ -73,7 +73,7 @@ class AiVideoAutoPublish extends Command
$this->output('开始自动发布Video文章');
$projectModel = new Project();
$optimizeModel = new DeployOptimize();
$projectList = $projectModel->list(['is_ai_video'=>1,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id','project_type']);
$projectList = $projectModel->list(['is_ai_video'=>1,'type'=>['in',[1,2,3,4,6]],'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id','project_type']);
foreach ($projectList as $item){
$this->output("项目{$item['id']}开始自动发布");
//获取当前是否开启自动发布aiVideo
... ...
... ... @@ -43,7 +43,7 @@ class RemainDay extends Command
* @var 暂停的项目
*/
protected $ceaseProjectId = [
354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685, 3309
354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685
];//需要单独处理的项目
/**
* The console command description.
... ...
... ... @@ -85,7 +85,7 @@ class TicketCount extends Command
$timeCount = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1])->sum('end_time');
$complete_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]]);
if(!empty($timeCount)){
$average_time = round($timeCount / $complete_num, 2);
$average_time = round($timeCount / $complete_num, 3);
}
//最快完成的时间
$fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time');
... ... @@ -96,7 +96,7 @@ class TicketCount extends Command
//超时工单数量
$timeout_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
if(!empty($timeout_num)){
$timeout_ratio = round($timeout_num / $ticket_num, 2);
$timeout_ratio = round($timeout_num / $ticket_num, 3);
}
$data = [
'date'=>$date,
... ... @@ -145,12 +145,12 @@ class TicketCount extends Command
$ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]);
$timeCount = $ticketLogModel->formatQuery(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1])->sum('end_time');
if(!empty($timeCount)){
$average_time = round($timeCount / $ticket_num, 2);
$average_time = round($timeCount / $ticket_num, 3);
}
//超期工单数量
$timeout_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
if(!empty($timeout_num)){
$timeout_ratio = round($timeout_num / $ticket_num, 2);
$timeout_ratio = round($timeout_num / $ticket_num, 3);
}
$data = [
'date'=>$date,
... ... @@ -185,7 +185,7 @@ class TicketCount extends Command
$time_end_num = $ticketModel->counts(['end_at'=>['!=',null]]);//已完成的工单
$time_end_count = $ticketModel->formatQuery(['end_at'=>['!=',null]])->sum('end_time');//已完成工单时长
if(!empty($time_end_count)){
$average_time = round($time_end_count / $time_end_num, 2);
$average_time = round($time_end_count / $time_end_num, 3);
}
$add_num = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);
$untreated_num = $ticketModel->counts(['end_at'=>null]);
... ... @@ -202,7 +202,7 @@ class TicketCount extends Command
$timeout_num = $ticketModel->counts(['end_at'=>null,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
$timeout_ratio = null;
if(!empty($timeout_num)){
$timeout_ratio = round($timeout_num / $ticket_num, 2);
$timeout_ratio = round($timeout_num / $ticket_num, 3);
}
$data = [
'date' => $date,
... ...
... ... @@ -62,7 +62,10 @@ class ServersController extends BaseController
unset($this->map['project_name']);
}
if(isset($this->map['domain']) && !empty($this->map['domain'])){
$this->map['domain'] = parse_url($this->map['domain'], PHP_URL_HOST); // 直接取域名部分
$domain = parse_url($this->map['domain'], PHP_URL_HOST); // 直接取域名部分
if(!empty($domain)){
$this->map['domain'] = $domain;
}
$domainModel = new DomainInfo();
$domainInfo = $domainModel->read(['domain'=>['like','%'.$this->map['domain'].'%']],['id','project_id']);
if($domainInfo !== false && !empty($domainInfo['project_id'])){
... ...
... ... @@ -88,7 +88,7 @@ class AsideTicketLogController extends BaseController
{
// 如果所有子任务都完成了,则将工单状态改为已完成
// todo 注意:建站期间的工单,所有人都完成后,不自动完成工单,需要项目经理验收修改工单状态
if (!($ticket->project->status == 1 && in_array($ticket->project->project_cate, [1, 2])))
if (($ticket->title == 'GEO项目') || !($ticket->project->status == 1 && in_array($ticket->project->project_cate, [1, 2])))
{
$ticket->status = Tickets::STATUS_COMPLETED;
$ticket->end_at = now();
... ...
... ... @@ -109,7 +109,7 @@ class AyrShareController extends BaseController
'id.required' => 'ID不能为空'
]);
$info = $ayrShareLogic->ayr_share_info();
if(!empty($info['title'])){
if(!empty($info['profile_key'])){
$data = [
// 'title'=>$info['title'],
'profileKey'=>$info['profile_key']
... ...
... ... @@ -88,11 +88,11 @@ class GeoLogic extends BaseLogic
$this->param['url'] = json_encode($this->param['url'] ?? [],true);
$this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
//执行时间设置为今天
$this->param['next_time'] = date('Y-m-d');
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
}else{
$this->param['next_time'] = date('Y-m-d');
$id = $this->model->addReturnId($this->param);
}
return $this->success(['id'=>$id]);
... ...
... ... @@ -90,12 +90,17 @@ class GeoQuestionResLogic extends BaseLogic
public function countQuantity(){
$questionModel = new GeoQuestion();
$list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']);
$questionTotalCount = $urlTotalCount = $keywordsTotalCount = $keywordUrlCount = 0;
$core_question_count = $questionTotalCount = $urlTotalCount = $keywordsTotalCount = 0;
$keywordArr = [];
$questionLogModel = new GeoQuestionLog();
$keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]);
$coreKeywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'label'=>['like','%核心问题%'],'hit'=>['!=',0]]);
foreach ($list as $item){
$questionTotalCount += count($item['question'] ?? []);
//核心问题数
if(strpos($item['label'],'核心问题') !== false){
$core_question_count += count($item['question'] ?? []);
}
$keywordsTotalCount += count($item['keywords'] ?? []);
$urlTotalCount += count($item['url'] ?? []);
foreach ($item['keywords'] as $keyWordItem){
... ... @@ -110,6 +115,8 @@ class GeoQuestionResLogic extends BaseLogic
'question_count'=>$questionTotalCount,
'keywords_url_count'=>$keywordUrlCount,
'keywords_arr' => $keywordArr,
'core_question_count'=>$core_question_count,
'core_keyword_url_count'=>$coreKeywordUrlCount
];
return $this->success($data);
}
... ...
... ... @@ -555,7 +555,7 @@ class RankDataLogic extends BaseLogic
$without_extension_project_ids = [658]; //是否达标只统计主词的
$extension_project_ids = [354]; //扩展词也到达标的
$compliance_project_ids = [2163,257,823,1750,497]; //直接达标处理的
$ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685,3309];//暂停的项目
$ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685];//暂停的项目
$uptimeProjectId = [1434,1812,276,2414,2974];//按上线时间统计的项目
//一个项目多个api_no
$multiple_api_no_project_ids = [
... ...