作者 ZhengBing He

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

正在显示 40 个修改的文件 包含 360 行增加115 行删除
@@ -9,9 +9,14 @@ @@ -9,9 +9,14 @@
9 9
10 namespace App\Console\Commands\Ai; 10 namespace App\Console\Commands\Ai;
11 11
  12 +use App\Helper\Arr;
  13 +use App\Models\Com\Notify;
  14 +use App\Models\Devops\ServerConfig;
  15 +use App\Models\Devops\ServersIp;
12 use App\Models\Domain\DomainInfo; 16 use App\Models\Domain\DomainInfo;
13 use App\Models\Project\AiBlogTask as AiBlogTaskModel; 17 use App\Models\Project\AiBlogTask as AiBlogTaskModel;
14 use App\Models\Ai\AiBlogAuthor as AiBlogAuthorModel; 18 use App\Models\Ai\AiBlogAuthor as AiBlogAuthorModel;
  19 +use App\Models\Project\Project;
15 use App\Services\AiBlogService; 20 use App\Services\AiBlogService;
16 use App\Services\ProjectServer; 21 use App\Services\ProjectServer;
17 use Illuminate\Console\Command; 22 use Illuminate\Console\Command;
@@ -105,6 +110,40 @@ class AiBlogAuthorId extends Command @@ -105,6 +110,40 @@ class AiBlogAuthorId extends Command
105 * @time :2025/5/26 16:21 110 * @time :2025/5/26 16:21
106 */ 111 */
107 public function sendCPost($project_id){ 112 public function sendCPost($project_id){
  113 + //获取项目所在服务器
  114 + $project_model = new Project();
  115 + $project_info = $project_model->read(['id'=>$project_id],['serve_id','is_upgrade', 'main_lang_id']);
  116 + if(!$project_info){
  117 + return false;
  118 + }
  119 + $serve_ip_model = new ServersIp();
  120 + $serve_ip_info = $serve_ip_model->read(['id'=>$project_info['serve_id']],['servers_id']);
  121 + $servers_id = $serve_ip_info ? $serve_ip_info['servers_id'] : 0;
  122 + if($servers_id == ServerConfig::SELF_SITE_ID){
  123 + //自建站服务器:如果项目已经上线,不请求C端接口,数据直接入库
  124 + $domain_model = new DomainInfo();
  125 + $domain_info = $domain_model->read(['project_id'=>$project_id],['domain']);
  126 + if($domain_info){
  127 + //判断是否已有更新进行中
  128 + $notify_model = new Notify();
  129 + $data = [
  130 + 'project_id' => $project_id,
  131 + 'type' => 1,
  132 + 'route' => 3,
  133 + 'server_id' => ServerConfig::SELF_SITE_ID,
  134 + 'status' => ['!=',Notify::STATUS_FINISH_SITEMAP]
  135 + ];
  136 + $notify = $notify_model->read($data,['id']);
  137 + if(!$notify){
  138 + $domain = $domain_info['domain'];
  139 + $data['data'] = Arr::a2s(['domain'=>$domain,'url'=>$this->route,'language'=>[]]);
  140 + $data['status'] = Notify::STATUS_INIT;
  141 + $data['is_pull_html_zip'] = Notify::IS_PULL_HTML_ZIP_FALSE;
  142 + $data['sort'] = 1;
  143 + $notify_model->add($data);
  144 + }
  145 + }
  146 + }else{
108 $domainModel = new DomainInfo(); 147 $domainModel = new DomainInfo();
109 $domain = $domainModel->getProjectIdDomain($project_id); 148 $domain = $domainModel->getProjectIdDomain($project_id);
110 $c_url = $domain.'api/update_page/'; 149 $c_url = $domain.'api/update_page/';
@@ -119,4 +158,5 @@ class AiBlogAuthorId extends Command @@ -119,4 +158,5 @@ class AiBlogAuthorId extends Command
119 $res = http_post($c_url, json_encode($param,true)); 158 $res = http_post($c_url, json_encode($param,true));
120 echo 'notify: project id: ' . $project_id . ', result: ' . json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); 159 echo 'notify: project id: ' . $project_id . ', result: ' . json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
121 } 160 }
  161 + }
122 } 162 }
@@ -60,7 +60,7 @@ class AiBlogAutoPublish extends Command @@ -60,7 +60,7 @@ class AiBlogAutoPublish extends Command
60 public function auto_publish() 60 public function auto_publish()
61 { 61 {
62 $this->output('开始自动发布博客文章'); 62 $this->output('开始自动发布博客文章');
63 - $projects = Project::where('is_ai_blog', 1)->where('delete_status',0)->where('site_status',0)->where('extend_type',0)->get(); 63 + $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();
64 foreach ($projects as $project) { 64 foreach ($projects as $project) {
65 try { 65 try {
66 $this->output("项目{$project->id}开始自动发布"); 66 $this->output("项目{$project->id}开始自动发布");
@@ -100,6 +100,9 @@ class AiBlogAutoPublish extends Command @@ -100,6 +100,9 @@ class AiBlogAutoPublish extends Command
100 //2、未达标的项目,开启AIblog, 并立即推送三篇; 100 //2、未达标的项目,开启AIblog, 并立即推送三篇;
101 //3、其他项目等下下周 1 (2025-03-17)开始推送第一篇, 之后按照正频率发送; 101 //3、其他项目等下下周 1 (2025-03-17)开始推送第一篇, 之后按照正频率发送;
102 if (!$last_task) { 102 if (!$last_task) {
  103 + if(strpos($frequency[0],'/')){
  104 + $frequency = [1,1];//默认每天执行
  105 + }
103 if(!$compliance) { 106 if(!$compliance) {
104 for ($i = 0; $i < 3; $i++) { 107 for ($i = 0; $i < 3; $i++) {
105 $this->createTask($keywords, $project->id, $frequency); 108 $this->createTask($keywords, $project->id, $frequency);
@@ -110,8 +113,19 @@ class AiBlogAutoPublish extends Command @@ -110,8 +113,19 @@ class AiBlogAutoPublish extends Command
110 } 113 }
111 } 114 }
112 } else { 115 } else {
  116 + if($frequency[0] == '1/2'){//一天2篇
  117 + $aiBlogTaskModel = new AiBlogTaskModel();
  118 + $frequency = explode('/', $frequency[0]);
  119 + //查询当前已发布几篇
  120 + $count = $aiBlogTaskModel->counts(['next_auto_date' => date('Y-m-d'),'project_id' => $project->id]);
  121 + while ($count < ($frequency[1] ?? 2)){
  122 + $this->createTask($keywords, $project->id, [$frequency[0],$frequency[0]]);
  123 + $count++;
  124 + }
  125 + }else{
113 $this->createTask($keywords, $project->id, $frequency); 126 $this->createTask($keywords, $project->id, $frequency);
114 } 127 }
  128 + }
115 }catch (\Exception $e){ 129 }catch (\Exception $e){
116 (new DingService())->handle([ 130 (new DingService())->handle([
117 'keyword' => 'AI_BLOG自动发布失败', 131 'keyword' => 'AI_BLOG自动发布失败',
@@ -133,7 +147,7 @@ class AiBlogAutoPublish extends Command @@ -133,7 +147,7 @@ class AiBlogAutoPublish extends Command
133 $result = $aiBlogService->createTask($keyword); 147 $result = $aiBlogService->createTask($keyword);
134 if ($result['status'] == 200) { 148 if ($result['status'] == 200) {
135 $aiBlogTaskModel = new AiBlogTaskModel(); 149 $aiBlogTaskModel = new AiBlogTaskModel();
136 - $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand($frequency[0],$frequency[1]) . 'days')); //每3-6天自动发布 150 + $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand($frequency[0] ?? 3, $frequency[1] ?? 6) . 'days')); //每3-6天自动发布
137 $aiBlogTaskModel->addReturnId(['project_id' => $project_id, 'type' => 2, 'task_id' => $result['data']['task_id'], 'status' => 1, 'next_auto_date' => $next_auto_date]); 151 $aiBlogTaskModel->addReturnId(['project_id' => $project_id, 'type' => 2, 'task_id' => $result['data']['task_id'], 'status' => 1, 'next_auto_date' => $next_auto_date]);
138 ProjectServer::useProject($project_id); 152 ProjectServer::useProject($project_id);
139 $aiBlogModel = new AiBlog(); 153 $aiBlogModel = new AiBlog();
@@ -141,7 +155,6 @@ class AiBlogAutoPublish extends Command @@ -141,7 +155,6 @@ class AiBlogAutoPublish extends Command
141 $end = strtotime('16:00:00'); 155 $end = strtotime('16:00:00');
142 $randomTimestamp = mt_rand($start, $end); 156 $randomTimestamp = mt_rand($start, $end);
143 $created_at = date("Y-m-d H:i:s", $randomTimestamp); 157 $created_at = date("Y-m-d H:i:s", $randomTimestamp);
144 -  
145 $aiBlogModel->addReturnId(['keyword' => $keyword, 'status' => 1, 'task_id' => $result['data']['task_id'], 'project_id' => $project_id, 'created_at' => $created_at]); 158 $aiBlogModel->addReturnId(['keyword' => $keyword, 'status' => 1, 'task_id' => $result['data']['task_id'], 'project_id' => $project_id, 'created_at' => $created_at]);
146 DB::disconnect('custom_mysql'); 159 DB::disconnect('custom_mysql');
147 $this->output("任务创建成功"); 160 $this->output("任务创建成功");
@@ -73,7 +73,7 @@ class AiVideoAutoPublish extends Command @@ -73,7 +73,7 @@ class AiVideoAutoPublish extends Command
73 $this->output('开始自动发布Video文章'); 73 $this->output('开始自动发布Video文章');
74 $projectModel = new Project(); 74 $projectModel = new Project();
75 $optimizeModel = new DeployOptimize(); 75 $optimizeModel = new DeployOptimize();
76 - $projectList = $projectModel->list(['is_ai_video'=>1,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id','project_type']); 76 + $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']);
77 foreach ($projectList as $item){ 77 foreach ($projectList as $item){
78 $this->output("项目{$item['id']}开始自动发布"); 78 $this->output("项目{$item['id']}开始自动发布");
79 //获取当前是否开启自动发布aiVideo 79 //获取当前是否开启自动发布aiVideo
@@ -241,7 +241,7 @@ class AiVideoAutoPublish extends Command @@ -241,7 +241,7 @@ class AiVideoAutoPublish extends Command
241 $storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1]; 241 $storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1];
242 $frequency = $aiVideoTaskModel->videoFrequency()[$frequency_setting ?? 1]; 242 $frequency = $aiVideoTaskModel->videoFrequency()[$frequency_setting ?? 1];
243 $frequencyArr = explode('-',$frequency); 243 $frequencyArr = explode('-',$frequency);
244 - $result = $aiVideoService->createTask($info['title'],$info['remark'],$info['images'],[],$storage); 244 + $result = $aiVideoService->createTask($info['title'],$info['remark'],array_slice($info['images'], 0, 8),[],$storage);
245 if($result['status'] == 200){ 245 if($result['status'] == 200){
246 $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand($frequencyArr[0] ?? 5,$frequencyArr[1] ?? 7) . 'days')); //每5-7天自动发布 246 $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand($frequencyArr[0] ?? 5,$frequencyArr[1] ?? 7) . 'days')); //每5-7天自动发布
247 $aiVideoTaskModel->addReturnId(['next_auto_date'=>$next_auto_date,'task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]); 247 $aiVideoTaskModel->addReturnId(['next_auto_date'=>$next_auto_date,'task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]);
@@ -250,6 +250,8 @@ class AiVideoAutoPublish extends Command @@ -250,6 +250,8 @@ class AiVideoAutoPublish extends Command
250 $aiVideoModel->addReturnId(['title'=>$info['title'],'task_id'=>$result['data']['task_id'],'description'=>$info['remark'],'project_id'=>$info['project_id'],'images'=>json_encode($info['images'],true),'anchor'=>json_encode([],true)]); 250 $aiVideoModel->addReturnId(['title'=>$info['title'],'task_id'=>$result['data']['task_id'],'description'=>$info['remark'],'project_id'=>$info['project_id'],'images'=>json_encode($info['images'],true),'anchor'=>json_encode([],true)]);
251 DB::disconnect('custom_mysql'); 251 DB::disconnect('custom_mysql');
252 $aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]); 252 $aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]);
  253 + }else{
  254 + $aiVideoAutoLogModel->edit(['status'=>3],['id'=>$info['id']]);
253 } 255 }
254 }catch (\Exception $e){ 256 }catch (\Exception $e){
255 $this->output( date('Y-m-d H:i:s').':当前数据不存在或已被删除'.$task_id); 257 $this->output( date('Y-m-d H:i:s').':当前数据不存在或已被删除'.$task_id);
@@ -36,12 +36,11 @@ class DomainInfo extends Command @@ -36,12 +36,11 @@ class DomainInfo extends Command
36 */ 36 */
37 protected $description = '域名相关'; 37 protected $description = '域名相关';
38 38
  39 + private $domains = [];
  40 +
39 /** 41 /**
40 - * @remark :更新证书+证书有效时间  
41 - * @name :handle  
42 - * @author :lyh  
43 - * @method :post  
44 - * @time :2023/9/11 15:09 42 + * 更新证书+证书有效时间
  43 + * @return bool
45 */ 44 */
46 public function handle() 45 public function handle()
47 { 46 {
@@ -57,6 +56,9 @@ class DomainInfo extends Command @@ -57,6 +56,9 @@ class DomainInfo extends Command
57 //创建的自定义小语种域名证书到期更新 56 //创建的自定义小语种域名证书到期更新
58 $this->startUpdateCustomCert(); 57 $this->startUpdateCustomCert();
59 58
  59 + // 推送v5项目域名到期信息
  60 + $this->domainChatMessageV5();
  61 +
60 return true; 62 return true;
61 } 63 }
62 64
@@ -100,14 +102,14 @@ class DomainInfo extends Command @@ -100,14 +102,14 @@ class DomainInfo extends Command
100 $v->domain_start_time = $valid_time['start']; 102 $v->domain_start_time = $valid_time['start'];
101 $v->domain_end_time = $valid_time['end']; 103 $v->domain_end_time = $valid_time['end'];
102 $v->save(); 104 $v->save();
103 - }  
104 - }  
105 105
106 //域名到期提醒 106 //域名到期提醒
107 - if ($v->domain_end_time && $v->domain_end_time < $end_day) {  
108 - $is_end = $v->domain_end_time < date('Y-m-d H:i:s') ? 1 : 0; 107 + if ($v['is_expire_remind'] && $valid_time['end'] < $end_day) {
  108 + $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
109 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end); 109 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
110 } 110 }
  111 + }
  112 + }
111 } else { 113 } else {
112 //除自建站项目外,记录已解析到别的ip的域名 114 //除自建站项目外,记录已解析到别的ip的域名
113 if (!check_domain_record($v['domain'], $servers_ip_info)) { 115 if (!check_domain_record($v['domain'], $servers_ip_info)) {
@@ -141,14 +143,14 @@ class DomainInfo extends Command @@ -141,14 +143,14 @@ class DomainInfo extends Command
141 $v->domain_start_time = $valid_time['start']; 143 $v->domain_start_time = $valid_time['start'];
142 $v->domain_end_time = $valid_time['end']; 144 $v->domain_end_time = $valid_time['end'];
143 $v->save(); 145 $v->save();
144 - }  
145 - }  
146 146
147 //域名到期提醒 147 //域名到期提醒
148 - if ($v->domain_end_time && $v->domain_end_time < $end_day) {  
149 - $is_end = $v->domain_end_time < date('Y-m-d H:i:s') ? 1 : 0; 148 + if ($v['is_expire_remind'] && $valid_time['end'] < $end_day) {
  149 + $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
150 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end); 150 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
151 } 151 }
  152 + }
  153 + }
152 154
153 if ($v['amp_status'] == 1) { 155 if ($v['amp_status'] == 1) {
154 $domain_array = parse_url($v['domain']); 156 $domain_array = parse_url($v['domain']);
@@ -401,19 +403,28 @@ class DomainInfo extends Command @@ -401,19 +403,28 @@ class DomainInfo extends Command
401 * @param $domain_id 403 * @param $domain_id
402 * @param $domain 404 * @param $domain
403 * @param $is_end 405 * @param $is_end
  406 + * @return bool
404 * @author Akun 407 * @author Akun
405 * @date 2025/08/14 9:56 408 * @date 2025/08/14 9:56
406 */ 409 */
407 public function domainChatMessage($project_id, $domain_id, $domain, $is_end) 410 public function domainChatMessage($project_id, $domain_id, $domain, $is_end)
408 { 411 {
  412 + //每周一推送
  413 + $week_day = date('w');
  414 + if ($week_day != 1) {
  415 + return true;
  416 + }
  417 +
409 //项目是否有绑定群 418 //项目是否有绑定群
410 $friend_id = ProjectAssociation::where('project_id', $project_id) 419 $friend_id = ProjectAssociation::where('project_id', $project_id)
411 ->where('status', ProjectAssociation::STATUS_NORMAL) 420 ->where('status', ProjectAssociation::STATUS_NORMAL)
412 ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT) 421 ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT)
413 ->value('friend_id'); 422 ->value('friend_id');
414 if ($friend_id) { 423 if ($friend_id) {
415 - $tips = $is_end ? ' 已经到期' : ' 即将到期';  
416 - $message = '【域名到期提醒】' . PHP_EOL . '域名 ' . $domain . $tips . ',请及时处理。'; 424 + $top_domain = getTopDomain($domain);
  425 + $this->domains[] = $top_domain;
  426 + $tips = $is_end ? ' 已经到期,请及时处理。' : ' 有效期不足一个月,请留意。';
  427 + $message = '【域名到期提醒】' . PHP_EOL . '域名 ' . $top_domain . $tips;
417 $param = [ 428 $param = [
418 'project_id' => $project_id, 429 'project_id' => $project_id,
419 'friend_id' => $friend_id, 430 'friend_id' => $friend_id,
@@ -427,5 +438,55 @@ class DomainInfo extends Command @@ -427,5 +438,55 @@ class DomainInfo extends Command
427 $messagePushModel = new MessagePush(); 438 $messagePushModel = new MessagePush();
428 $messagePushModel->add($param); 439 $messagePushModel->add($param);
429 } 440 }
  441 +
  442 + return true;
  443 + }
  444 +
  445 + /**
  446 + * 推送v5 项目域名到期时间
  447 + * @return bool
  448 + */
  449 + public function domainChatMessageV5()
  450 + {
  451 + //每周一推送
  452 + $week_day = date('w');
  453 + if ($week_day != 1) {
  454 + return true;
  455 + }
  456 +
  457 + $domain_json = @file_get_contents('https://www.quanqiusou.cn/extend_api/aicc/domain_expire_lists.php');
  458 + $domains = json_decode($domain_json, true);
  459 + if (empty($domains))
  460 + return true;
  461 +
  462 + $send_domain = $this->domains;
  463 + $today = date('Y-m-d');
  464 + $messagePushModel = new MessagePush();
  465 + foreach ($domains as $item) {
  466 + if (empty($item['domain']) || empty($item['friend_id'])) {
  467 + continue;
  468 + }
  469 + // 避免重复推送域名到期提示
  470 + if (in_array($item['domain'], $send_domain)) {
  471 + continue;
  472 + } else {
  473 + array_push($send_domain, $item['domain']);
  474 + }
  475 +
  476 + $tips = $item['end_at'] >= $today ? ' 有效期不足一个月,请留意。' : ' 已经到期,请及时处理。';
  477 + $message = '【域名到期提醒】' . PHP_EOL . '域名 ' . $item['domain'] . $tips;
  478 + $param = [
  479 + 'project_id' => $item['project_id'],
  480 + 'friend_id' => $item['friend_id'],
  481 + 'type' => MessagePush::TYPE_DOMAIN_V5,
  482 + 'content' => $message,
  483 + 'ref_ids' => 0,
  484 + 'send_time' => date('Y-m-d 15:00:00'),
  485 + 'status' => 0,
  486 + ];
  487 + //写入一条推送消息 自动消费
  488 + $messagePushModel->add($param);
  489 + }
  490 + return true;
430 } 491 }
431 } 492 }
@@ -35,7 +35,7 @@ class RemainDay extends Command @@ -35,7 +35,7 @@ class RemainDay extends Command
35 * 按照达标天数收费的项目(白帽) 35 * 按照达标天数收费的项目(白帽)
36 */ 36 */
37 protected $bm_projectId = [ 37 protected $bm_projectId = [
38 - 4247,4299,4310,4215,4038,4084,4148,4178 38 + 4247,4299,4310,4215,4038,4084,4148,4178,4405
39 ]; 39 ];
40 40
41 41
@@ -43,7 +43,7 @@ class RemainDay extends Command @@ -43,7 +43,7 @@ class RemainDay extends Command
43 * @var 暂停的项目 43 * @var 暂停的项目
44 */ 44 */
45 protected $ceaseProjectId = [ 45 protected $ceaseProjectId = [
46 - 354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685, 3309 46 + 354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250, 2193, 2399, 1685
47 ];//需要单独处理的项目 47 ];//需要单独处理的项目
48 /** 48 /**
49 * The console command description. 49 * The console command description.
@@ -120,7 +120,7 @@ class RemainDay extends Command @@ -120,7 +120,7 @@ class RemainDay extends Command
120 //白帽版本的系统 120 //白帽版本的系统
121 if($deploy_build['seo_plan'] == 1){ 121 if($deploy_build['seo_plan'] == 1){
122 if($deploy_build['seo_service_duration'] != 0){ 122 if($deploy_build['seo_service_duration'] != 0){
123 - if(in_array($item['id'],$this->bm_projectId) || (strpos($item['level'], '19') !== false)){ 123 + if(in_array($item['id'],$this->bm_projectId) || (in_array( 19,$item['level']))){
124 $compliance_day = (int)$item['bm_finish_remain_day']; 124 $compliance_day = (int)$item['bm_finish_remain_day'];
125 $seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day']; 125 $seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day'];
126 }else{ 126 }else{
@@ -61,7 +61,7 @@ class GeoQuestionRes extends Command @@ -61,7 +61,7 @@ class GeoQuestionRes extends Command
61 $geoQuestionModel->edit(['status'=>$geoQuestionModel::STATUS_CLOSE],['id'=>$task_id]); 61 $geoQuestionModel->edit(['status'=>$geoQuestionModel::STATUS_CLOSE],['id'=>$task_id]);
62 continue; 62 continue;
63 } 63 }
64 - if(empty($taskInfo['question']) || empty($taskInfo['keywords']) || empty($taskInfo['url'])){ 64 + if(empty($taskInfo['question']) || (empty($taskInfo['keywords']) && empty($taskInfo['url']) && empty($taskInfo['expect_result']))){
65 $this->output('task id: ' . $task_id . ', error: 任务数据缺失, continue!'); 65 $this->output('task id: ' . $task_id . ', error: 任务数据缺失, continue!');
66 $geoQuestionModel->edit(['status'=>$geoQuestionModel::STATUS_CLOSE],['id'=>$task_id]); 66 $geoQuestionModel->edit(['status'=>$geoQuestionModel::STATUS_CLOSE],['id'=>$task_id]);
67 continue; 67 continue;
@@ -113,7 +113,6 @@ class GeoQuestionRes extends Command @@ -113,7 +113,6 @@ class GeoQuestionRes extends Command
113 } 113 }
114 // 命中文案 114 // 命中文案
115 $hit_data[] = $result['text']; 115 $hit_data[] = $result['text'];
116 -  
117 if(!empty($result['annotations'])){ 116 if(!empty($result['annotations'])){
118 $url = array_column(array_column($result['annotations'], 'url_citation'), 'url'); 117 $url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
119 $title = array_column(array_column($result['annotations'], 'url_citation'), 'title'); 118 $title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
@@ -165,6 +164,7 @@ class GeoQuestionRes extends Command @@ -165,6 +164,7 @@ class GeoQuestionRes extends Command
165 'keywords_num'=>$keyword_num ?? [], 164 'keywords_num'=>$keyword_num ?? [],
166 'url_num'=>$url_num ?? [], 165 'url_num'=>$url_num ?? [],
167 'is_match'=>$is_match ?? 0, 166 'is_match'=>$is_match ?? 0,
  167 + 'label'=>$taskInfo['label'] ?? null,
168 'created_at'=>date('Y-m-d H:i:s'), 168 'created_at'=>date('Y-m-d H:i:s'),
169 'updated_at'=>date('Y-m-d H:i:s'), 169 'updated_at'=>date('Y-m-d H:i:s'),
170 ]; 170 ];
@@ -68,9 +68,7 @@ class UpdateRoute extends Command @@ -68,9 +68,7 @@ class UpdateRoute extends Command
68 */ 68 */
69 public function handle() 69 public function handle()
70 { 70 {
71 - ProjectServer::useProject(4132);  
72 - return $this->product_action(4132);  
73 - DB::disconnect('custom_mysql'); 71 + return $this->_action();
74 } 72 }
75 73
76 /** 74 /**
@@ -156,12 +154,17 @@ class UpdateRoute extends Command @@ -156,12 +154,17 @@ class UpdateRoute extends Command
156 */ 154 */
157 public function _action(){ 155 public function _action(){
158 $projectModel = new Project(); 156 $projectModel = new Project();
159 - $lists = $projectModel->list(['delete_status'=>0,'extend_type'=>0,'type'=>['!=',0]],'id',['id']);  
160 - $keywordModel = new Keyword(); 157 + $lists = $projectModel->list(['id'=>['in',[4379,4380,4381,4382,4383]],'delete_status'=>0,'extend_type'=>0,'type'=>['!=',0]],'id',['id']);
161 foreach ($lists as $v){ 158 foreach ($lists as $v){
162 ProjectServer::useProject($v['id']); 159 ProjectServer::useProject($v['id']);
163 echo date('Y-m-d H:i:s').' 执行的项目id:'.$v['id'].PHP_EOL; 160 echo date('Y-m-d H:i:s').' 执行的项目id:'.$v['id'].PHP_EOL;
164 - $keywordModel->edit(['type'=>1],['id'=>['!=',0]]); 161 + $productModel = new Product();
  162 + $productModel->edit(['project_id'=>$v['id']],['id'=>['!=',0]]);
  163 + $productLists = $productModel->list([],'id',['id','title','route']);
  164 + foreach ($productLists as $item){
  165 + $route = RouteMap::setRoute($item['route'],'product',$item['id'],$v['id']);
  166 + $productModel->edit(['route'=>$route],['id'=>$item['id']]);
  167 + }
165 DB::disconnect('custom_mysql'); 168 DB::disconnect('custom_mysql');
166 } 169 }
167 return true; 170 return true;
@@ -50,7 +50,7 @@ class lyhDemo extends Command @@ -50,7 +50,7 @@ class lyhDemo extends Command
50 protected $description = '更新路由'; 50 protected $description = '更新路由';
51 51
52 public function handle(){ 52 public function handle(){
53 - return $this->getExpectResult(); 53 + return $this->_actionRoute();
54 return true; 54 return true;
55 } 55 }
56 56
@@ -74,25 +74,22 @@ class lyhDemo extends Command @@ -74,25 +74,22 @@ class lyhDemo extends Command
74 * @time :2025/7/22 15:14 74 * @time :2025/7/22 15:14
75 */ 75 */
76 public function _actionRoute(){ 76 public function _actionRoute(){
77 - $geo_service = new GeoService();  
78 - $data = $geo_service->getDeepSeekResult("创贸总共多少人?",'gpt-4o-mini'); 77 + $projectModel = new Project();
  78 + $lists = $projectModel->list(['delete_status' => 0,'is_ai_blog'=>1,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
  79 + $data = [];
  80 + foreach ($lists as $item){
  81 + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
  82 + ProjectServer::useProject($item['id']);
  83 + $aiBlogModel = new AiBlog();
  84 + $info = $aiBlogModel->read(['text'=>['like','%href="blog/%']],['id']);
  85 + if($info !== false){
  86 + echo '需要处理->项目id:'.$item['id'].PHP_EOL;
  87 + $data[] = $item['id'];
  88 + }
  89 + echo 'end';
  90 + DB::disconnect('custom_mysql');
  91 + }
79 dd($data); 92 dd($data);
80 -// $projectModel = new Project();  
81 -// $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']);  
82 -// $data = [];  
83 -// foreach ($lists as $item){  
84 -// echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;  
85 -// ProjectServer::useProject($item['id']);  
86 -// $aiBlogModel = new AiBlog();  
87 -// $info = $aiBlogModel->read(['route'=>null],['id']);  
88 -// if($info !== false){  
89 -// echo '项目id:'.$item['id'].PHP_EOL;  
90 -// $data[] = $item['id'];  
91 -// }  
92 -// dd($data);  
93 -// echo 'end';  
94 -// DB::disconnect('custom_mysql');  
95 -// }  
96 } 93 }
97 94
98 public function _actionTemplateMain(){ 95 public function _actionTemplateMain(){
@@ -55,7 +55,7 @@ class RankData extends BaseCommands @@ -55,7 +55,7 @@ class RankData extends BaseCommands
55 ->where('gl_project.delete_status',0) 55 ->where('gl_project.delete_status',0)
56 ->where('gl_project_deploy_optimize.api_no', '>', 0) 56 ->where('gl_project_deploy_optimize.api_no', '>', 0)
57 ->whereIn('gl_project.type',[2,4]) 57 ->whereIn('gl_project.type',[2,4])
58 - ->whereRaw("FIND_IN_SET('2', gl_project.level) = 0 AND FIND_IN_SET('3', gl_project.level) = 0") 58 + ->whereRaw("FIND_IN_SET('2', gl_project.level) = 0")
59 ->select(['gl_project_deploy_optimize.api_no as api_no', 'gl_project_deploy_optimize.project_id as project_id']) 59 ->select(['gl_project_deploy_optimize.api_no as api_no', 'gl_project_deploy_optimize.project_id as project_id'])
60 ->orderBy('gl_project.id', 'asc') 60 ->orderBy('gl_project.id', 'asc')
61 ->get()->toArray(); 61 ->get()->toArray();
@@ -83,7 +83,7 @@ class RankData extends BaseCommands @@ -83,7 +83,7 @@ class RankData extends BaseCommands
83 //白帽SEO版 83 //白帽SEO版
84 $list = Project::leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') 84 $list = Project::leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')
85 ->where('gl_project.delete_status',0) 85 ->where('gl_project.delete_status',0)
86 - ->where('gl_project_deploy_build.seo_plan', 1) 86 + ->where('gl_project_deploy_build.seo_plan', '>', 0)
87 ->whereIn('gl_project.type',[2,3,4]) 87 ->whereIn('gl_project.type',[2,3,4])
88 ->orderBy('gl_project.id', 'asc') 88 ->orderBy('gl_project.id', 'asc')
89 ->pluck('gl_project.id')->toArray(); 89 ->pluck('gl_project.id')->toArray();
@@ -76,31 +76,39 @@ class TicketCount extends Command @@ -76,31 +76,39 @@ class TicketCount extends Command
76 $date = Carbon::yesterday()->toDateString(); // 昨日时间 76 $date = Carbon::yesterday()->toDateString(); // 昨日时间
77 $ticketManageCountModel = new TicketDailyManageCount(); 77 $ticketManageCountModel = new TicketDailyManageCount();
78 foreach ($manageList as $item){ 78 foreach ($manageList as $item){
79 - $average_time = ''; 79 + $average_time = null;
  80 + $timeout_ratio = null;
80 $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']); 81 $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']);
81 $ticketLogModel = new TicketLog(); 82 $ticketLogModel = new TicketLog();
82 $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]); 83 $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
83 //工单总时长 84 //工单总时长
84 $timeCount = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1])->sum('end_time'); 85 $timeCount = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1])->sum('end_time');
85 - $ticket_end_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]]); 86 + $complete_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]]);
86 if(!empty($timeCount)){ 87 if(!empty($timeCount)){
87 - $average_time = round($timeCount / $ticket_end_num, 2); 88 + $average_time = round($timeCount / $complete_num, 3);
88 } 89 }
89 //最快完成的时间 90 //最快完成的时间
90 $fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time'); 91 $fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time');
  92 + //最快完成时间
  93 + if(!$fastest_time){
  94 + $fastest_time = null;
  95 + }
91 //超时工单数量 96 //超时工单数量
92 - $timeout_num = $ticketLogModel->counts(['end_at'=>null,'engineer_id'=>$item['manage_id'],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);  
93 - $complete_num = $ticketLogModel->counts(['end_at'=>['!=',null],'engineer_id'=>$item['manage_id'],'is_engineer'=>1]); 97 + $timeout_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
  98 + if(!empty($timeout_num)){
  99 + $timeout_ratio = round($timeout_num / $ticket_num, 3);
  100 + }
94 $data = [ 101 $data = [
95 'date'=>$date, 102 'date'=>$date,
96 'manage_id'=>$item['id'], 103 'manage_id'=>$item['id'],
97 'manage_name'=>$item['name'], 104 'manage_name'=>$item['name'],
98 'ticket_num'=>$ticket_num,//工单总数量 105 'ticket_num'=>$ticket_num,//工单总数量
99 - 'average_time'=>$average_time ?? '',//平均完成工单时长  
100 - 'fastest_time'=>$fastest_time,//最快完成工单时间 106 + 'average_time'=>$average_time ?? null,//平均完成工单时长
  107 + 'fastest_time'=>$fastest_time ?? null,//最快完成工单时间
101 'timeout_num'=>$timeout_num,//超时工单数量 108 'timeout_num'=>$timeout_num,//超时工单数量
102 'complete_num'=>$complete_num,//完成工单数量 109 'complete_num'=>$complete_num,//完成工单数量
103 - 'dept_id'=>$item['dept_id'] 110 + 'dept_id'=>$item['dept_id'],
  111 + 'timeout_ratio'=>$timeout_ratio ?? null
104 ]; 112 ];
105 //查询当前用户是否当日已有记录 113 //查询当前用户是否当日已有记录
106 $ticketManageInfo = $ticketManageCountModel->read(['date'=>$date,'manage_id'=>$item['id']],['id']); 114 $ticketManageInfo = $ticketManageCountModel->read(['date'=>$date,'manage_id'=>$item['id']],['id']);
@@ -130,20 +138,28 @@ class TicketCount extends Command @@ -130,20 +138,28 @@ class TicketCount extends Command
130 $ticketDailyDeptModel = new TicketDailyDeptCount(); 138 $ticketDailyDeptModel = new TicketDailyDeptCount();
131 $date = Carbon::yesterday()->toDateString(); // "2025-08-07" 139 $date = Carbon::yesterday()->toDateString(); // "2025-08-07"
132 foreach ($groupList as $item){ 140 foreach ($groupList as $item){
133 - $average_time = ''; 141 + $average_time = null;
  142 + $timeout_ratio = null;
134 $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']); 143 $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']);
135 $manageIdArr = $manageHrModel->selectField(['belong_group'=>$item['id'],'status'=>1,'dept_id'=>1],'manage_id'); 144 $manageIdArr = $manageHrModel->selectField(['belong_group'=>$item['id'],'status'=>1,'dept_id'=>1],'manage_id');
136 $ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]); 145 $ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]);
137 $timeCount = $ticketLogModel->formatQuery(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1])->sum('end_time'); 146 $timeCount = $ticketLogModel->formatQuery(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1])->sum('end_time');
138 if(!empty($timeCount)){ 147 if(!empty($timeCount)){
139 - $average_time = round($timeCount / $ticket_num, 2); 148 + $average_time = round($timeCount / $ticket_num, 3);
  149 + }
  150 + //超期工单数量
  151 + $timeout_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
  152 + if(!empty($timeout_num)){
  153 + $timeout_ratio = round($timeout_num / $ticket_num, 3);
140 } 154 }
141 $data = [ 155 $data = [
142 'date'=>$date, 156 'date'=>$date,
143 'dept_id'=>$item['id'], 157 'dept_id'=>$item['id'],
144 'dept_name'=>$item['name'], 158 'dept_name'=>$item['name'],
145 'ticket_num'=>$ticket_num ?? 0, 159 'ticket_num'=>$ticket_num ?? 0,
146 - 'average_time'=>$average_time ?? '' 160 + 'average_time'=>$average_time ?? null,
  161 + 'timeout_ratio'=>$timeout_ratio ?? null,
  162 + 'timeout_num'=>$timeout_num
147 ]; 163 ];
148 $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']); 164 $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']);
149 if($deptInfo === false){ 165 if($deptInfo === false){
@@ -169,7 +185,7 @@ class TicketCount extends Command @@ -169,7 +185,7 @@ class TicketCount extends Command
169 $time_end_num = $ticketModel->counts(['end_at'=>['!=',null]]);//已完成的工单 185 $time_end_num = $ticketModel->counts(['end_at'=>['!=',null]]);//已完成的工单
170 $time_end_count = $ticketModel->formatQuery(['end_at'=>['!=',null]])->sum('end_time');//已完成工单时长 186 $time_end_count = $ticketModel->formatQuery(['end_at'=>['!=',null]])->sum('end_time');//已完成工单时长
171 if(!empty($time_end_count)){ 187 if(!empty($time_end_count)){
172 - $average_time = round($time_end_count / $time_end_num, 2); 188 + $average_time = round($time_end_count / $time_end_num, 3);
173 } 189 }
174 $add_num = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]); 190 $add_num = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);
175 $untreated_num = $ticketModel->counts(['end_at'=>null]); 191 $untreated_num = $ticketModel->counts(['end_at'=>null]);
@@ -183,15 +199,22 @@ class TicketCount extends Command @@ -183,15 +199,22 @@ class TicketCount extends Command
183 ) 199 )
184 ->groupBy('p.project_cate') 200 ->groupBy('p.project_cate')
185 ->pluck('ticket_count', 'project_cate'); 201 ->pluck('ticket_count', 'project_cate');
  202 + $timeout_num = $ticketModel->counts(['end_at'=>null,'plan_end_at'=>['>',date('Y-m-d H:i:s')]]);
  203 + $timeout_ratio = null;
  204 + if(!empty($timeout_num)){
  205 + $timeout_ratio = round($timeout_num / $ticket_num, 3);
  206 + }
186 $data = [ 207 $data = [
187 'date' => $date, 208 'date' => $date,
188 'ticket_num'=>$ticket_num, 209 'ticket_num'=>$ticket_num,
189 'add_num'=>$add_num, 210 'add_num'=>$add_num,
190 'untreated_num'=>$untreated_num, 211 'untreated_num'=>$untreated_num,
191 'processed_num'=>$processed_num, 212 'processed_num'=>$processed_num,
192 - 'average_time'=>$average_time ?? '', 213 + 'average_time'=>$average_time ?? null,
193 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true), 214 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true),
194 - 'source_type'=>json_encode($dbResult,true) 215 + 'source_type'=>json_encode($dbResult,true),
  216 + 'timeout_num'=>$timeout_num,
  217 + 'timeout_ratio'=>$timeout_ratio ?? null
195 ]; 218 ];
196 $ticketDailyModel = new TicketDailyCount(); 219 $ticketDailyModel = new TicketDailyCount();
197 $ticketDailyInfo = $ticketDailyModel->read(['date'=>$date],['id']); 220 $ticketDailyInfo = $ticketDailyModel->read(['date'=>$date],['id']);
@@ -435,6 +435,7 @@ class WebTraffic extends Command @@ -435,6 +435,7 @@ class WebTraffic extends Command
435 } 435 }
436 })->inRandomOrder()->first(); 436 })->inRandomOrder()->first();
437 if(!$ipdata){ 437 if(!$ipdata){
  438 + $data[] = [];
438 continue; 439 continue;
439 } 440 }
440 $ipdata = (array)$ipdata ?: []; 441 $ipdata = (array)$ipdata ?: [];
@@ -480,6 +480,7 @@ class WebTrafficRussia extends Command @@ -480,6 +480,7 @@ class WebTrafficRussia extends Command
480 $ip_area = $this->get_rand($project_country); 480 $ip_area = $this->get_rand($project_country);
481 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); 481 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first();
482 if(!$res){ 482 if(!$res){
  483 + $data[] = [];
483 continue; 484 continue;
484 } 485 }
485 $res = (array)$res ?: []; 486 $res = (array)$res ?: [];
@@ -471,6 +471,7 @@ class WebTrafficRussiaSpecial extends Command @@ -471,6 +471,7 @@ class WebTrafficRussiaSpecial extends Command
471 $ip_area = $this->get_rand($project_country); 471 $ip_area = $this->get_rand($project_country);
472 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); 472 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first();
473 if(!$res){ 473 if(!$res){
  474 + $data[] = [];
474 continue; 475 continue;
475 } 476 }
476 $res = (array)$res ?: []; 477 $res = (array)$res ?: [];
@@ -421,6 +421,7 @@ class WebTrafficSpecial extends Command @@ -421,6 +421,7 @@ class WebTrafficSpecial extends Command
421 } 421 }
422 })->inRandomOrder()->first(); 422 })->inRandomOrder()->first();
423 if(!$ipdata){ 423 if(!$ipdata){
  424 + $data[] = [];
424 continue; 425 continue;
425 } 426 }
426 $ipdata = (array)$ipdata ?: []; 427 $ipdata = (array)$ipdata ?: [];
@@ -12,6 +12,7 @@ use App\Http\Logic\Bside\User\UserLoginLogic; @@ -12,6 +12,7 @@ use App\Http\Logic\Bside\User\UserLoginLogic;
12 use App\Models\Ai\AiBlog; 12 use App\Models\Ai\AiBlog;
13 use App\Models\Blog\Blog; 13 use App\Models\Blog\Blog;
14 use App\Models\Domain\DomainInfo; 14 use App\Models\Domain\DomainInfo;
  15 +use App\Models\Industry\ProjectIndustryRelated;
15 use App\Models\Inquiry\InquiryRelateDomain; 16 use App\Models\Inquiry\InquiryRelateDomain;
16 use App\Models\Manage\ManageHr; 17 use App\Models\Manage\ManageHr;
17 use App\Models\News\News; 18 use App\Models\News\News;
@@ -47,10 +48,12 @@ class PrivateController extends BaseController @@ -47,10 +48,12 @@ class PrivateController extends BaseController
47 public function optimizeProjectList(Request $request) 48 public function optimizeProjectList(Request $request)
48 { 49 {
49 $page_size = $request->input('page_size', 20); 50 $page_size = $request->input('page_size', 20);
50 - $field = ['gl_project.id', 'gl_project.company', 'gl_project.is_upgrade', 'b.start_date', 'd.domain', 'b.special']; 51 + $field = ['gl_project.id', 'gl_project.company', 'gl_project.is_upgrade', 'b.start_date', 'd.domain', 'b.special', 'gl_project.from_order_id'];// 'f.industry_name',
51 $result = Project::select($field)->leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id') 52 $result = Project::select($field)->leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id')
52 ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') 53 ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id')
53 ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') 54 ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id')
  55 +// ->leftJoin('gl_project_industry_related as e', 'gl_project.id', '=', 'e.project_id')
  56 +// ->leftJoin('gl_project_industry as f', 'e.industry_id', '=', 'f.id')
54 ->where('gl_project.type', Project::TYPE_TWO) 57 ->where('gl_project.type', Project::TYPE_TWO)
55 ->where('gl_project.project_type',Project::TYPE_ZERO) 58 ->where('gl_project.project_type',Project::TYPE_ZERO)
56 ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 59 ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制
@@ -60,6 +63,14 @@ class PrivateController extends BaseController @@ -60,6 +63,14 @@ class PrivateController extends BaseController
60 }) 63 })
61 ->paginate($page_size) 64 ->paginate($page_size)
62 ->toArray(); 65 ->toArray();
  66 +
  67 + // 直接关联查询, 会出现数据错误
  68 + $project_ids = array_column($result['list'], 'id');
  69 + $industry = ProjectIndustryRelated::leftJoin('gl_project_industry', 'gl_project_industry_related.industry_id', '=', 'gl_project_industry.id')->whereIn('project_id', $project_ids)->pluck('industry_name', 'project_id')->toArray();
  70 + foreach ($result['list'] as &$val) {
  71 + $val['industry_name'] = FALSE == empty($industry[$val['id']]) ? $industry[$val['id']] : '';
  72 + }
  73 +
63 return $this->success($result); 74 return $this->success($result);
64 } 75 }
65 76
@@ -62,6 +62,10 @@ class ServersController extends BaseController @@ -62,6 +62,10 @@ class ServersController extends BaseController
62 unset($this->map['project_name']); 62 unset($this->map['project_name']);
63 } 63 }
64 if(isset($this->map['domain']) && !empty($this->map['domain'])){ 64 if(isset($this->map['domain']) && !empty($this->map['domain'])){
  65 + $domain = parse_url($this->map['domain'], PHP_URL_HOST); // 直接取域名部分
  66 + if(!empty($domain)){
  67 + $this->map['domain'] = $domain;
  68 + }
65 $domainModel = new DomainInfo(); 69 $domainModel = new DomainInfo();
66 $domainInfo = $domainModel->read(['domain'=>['like','%'.$this->map['domain'].'%']],['id','project_id']); 70 $domainInfo = $domainModel->read(['domain'=>['like','%'.$this->map['domain'].'%']],['id','project_id']);
67 if($domainInfo !== false && !empty($domainInfo['project_id'])){ 71 if($domainInfo !== false && !empty($domainInfo['project_id'])){
@@ -74,6 +78,8 @@ class ServersController extends BaseController @@ -74,6 +78,8 @@ class ServersController extends BaseController
74 $this->map['id'] = $ipInfo['servers_id']; 78 $this->map['id'] = $ipInfo['servers_id'];
75 } 79 }
76 } 80 }
  81 + }else{
  82 + $this->map['id'] = 0;
77 } 83 }
78 unset($this->map['domain']); 84 unset($this->map['domain']);
79 } 85 }
@@ -96,17 +96,13 @@ class GeoQuestionController extends BaseController @@ -96,17 +96,13 @@ class GeoQuestionController extends BaseController
96 $this->request->validate([ 96 $this->request->validate([
97 'project_id'=>'required', 97 'project_id'=>'required',
98 'question'=>'required', 98 'question'=>'required',
99 - 'keywords'=>'required',  
100 - 'url'=>'required',  
101 'status'=>'required', 99 'status'=>'required',
102 'type'=>'required', 100 'type'=>'required',
103 ],[ 101 ],[
104 'project_id.required' => '项目ID不能为空', 102 'project_id.required' => '项目ID不能为空',
105 - 'question.required' => '项目ID不能为空',  
106 - 'keywords.required' => '项目ID不能为空',  
107 - 'url.required' => '项目ID不能为空',  
108 - 'status.required' => '项目ID不能为空',  
109 - 'type.required' => '类型不能为空', 103 + 'question.required' => 'question不能为空',
  104 + 'status.required' => 'status不能为空',
  105 + 'type.required' => 'type类型不能为空',
110 ]); 106 ]);
111 $data = $this->logic->saveGeoQuestion(); 107 $data = $this->logic->saveGeoQuestion();
112 $this->response('success',Code::SUCCESS,$data); 108 $this->response('success',Code::SUCCESS,$data);
@@ -525,6 +525,39 @@ class OptimizeController extends BaseController @@ -525,6 +525,39 @@ class OptimizeController extends BaseController
525 } 525 }
526 526
527 /** 527 /**
  528 + * @remark :获取聚合页链接数据
  529 + * @name :getKeywordRouteList
  530 + * @author :lyh
  531 + * @method :post
  532 + * @time :2025/8/22 15:02
  533 + */
  534 + public function getKeywordRouteList(){
  535 + $this->request->validate([
  536 + 'project_id' => 'required',
  537 + ], [
  538 + 'project_id.required' => 'project_id不能为空',
  539 + ]);
  540 + // 获取当前网站正式域名
  541 + $domainModel = new DomainInfo();
  542 + $domainInfo = $domainModel->read(['project_id' => $this->param['project_id']], ['domain']);
  543 + if ($domainInfo === false) {
  544 + $this->fail('请先设置域名');
  545 + }
  546 + $domain = 'https://' . $domainInfo['domain'] . '/';
  547 + ProjectServer::useProject($this->param['project_id']);
  548 + $productKeywordModel = new Keyword();
  549 + $data = [];
  550 + $lists = $productKeywordModel->list(['route'=>['!=',null]],'id',['id','route','seo_title']);
  551 + if (!empty($lists)){
  552 + foreach ($lists as $item){
  553 + $data[] = $domain . $item['route'] . '/{' . $item['seo_title'] . '}';
  554 + }
  555 + }
  556 + DB::disconnect('custom_mysql');
  557 + $this->response('success', Code::SUCCESS, $data);
  558 + }
  559 +
  560 + /**
528 * @remark :分片查询 561 * @remark :分片查询
529 * @name :processChunkedList 562 * @name :processChunkedList
530 * @author :lyh 563 * @author :lyh
@@ -540,6 +573,9 @@ class OptimizeController extends BaseController @@ -540,6 +573,9 @@ class OptimizeController extends BaseController
540 break; 573 break;
541 } 574 }
542 foreach ($chunk['list'] as $item) { 575 foreach ($chunk['list'] as $item) {
  576 + if(empty($item['route'])){
  577 + continue;
  578 + }
543 $data[$key][] = $domain . $item['route'] . '/{' . $item['title'] . '}'; 579 $data[$key][] = $domain . $item['route'] . '/{' . $item['title'] . '}';
544 } 580 }
545 $offset++; 581 $offset++;
@@ -1178,7 +1178,14 @@ class ProjectController extends BaseController @@ -1178,7 +1178,14 @@ class ProjectController extends BaseController
1178 $this->response('success'); 1178 $this->response('success');
1179 } 1179 }
1180 1180
1181 - if($projectInfo['serve_id'] == 8){ 1181 + //获取服务器数据
  1182 + $serverIpModel = new ServersIp();
  1183 + $serversIpInfo = $serverIpModel->read(['id' => $projectInfo['serve_id']], ['servers_id']);
  1184 + if(!$serversIpInfo){
  1185 + $this->fail('获取项目所属服务器失败');
  1186 + }
  1187 +
  1188 + if($serversIpInfo['servers_id'] == ServerConfig::SELF_SITE_ID){
1182 //自建站项目 1189 //自建站项目
1183 if($this->param['site_status'] == 1){ 1190 if($this->param['site_status'] == 1){
1184 //关闭站点 1191 //关闭站点
@@ -1206,12 +1213,6 @@ class ProjectController extends BaseController @@ -1206,12 +1213,6 @@ class ProjectController extends BaseController
1206 } 1213 }
1207 }else{ 1214 }else{
1208 //开启站点:创建建站任务 1215 //开启站点:创建建站任务
1209 - $serverIpModel = new ServersIp();  
1210 - $serversIpInfo = $serverIpModel->read(['id' => $projectInfo['serve_id']], ['servers_id']);  
1211 - if(!$serversIpInfo){  
1212 - $this->fail('获取项目所属服务器失败');  
1213 - }  
1214 -  
1215 if ($projectInfo['project_type'] == Project::PROJECT_TYPE_SEO) { 1216 if ($projectInfo['project_type'] == Project::PROJECT_TYPE_SEO) {
1216 $type = DomainCreateTask::TYPE_BLOG; 1217 $type = DomainCreateTask::TYPE_BLOG;
1217 } else { 1218 } else {
@@ -61,6 +61,15 @@ class RenewProjectController extends BaseController @@ -61,6 +61,15 @@ class RenewProjectController extends BaseController
61 if(!empty($param['search']) && !empty($param['search_type'])){ 61 if(!empty($param['search']) && !empty($param['search_type'])){
62 $map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"]; 62 $map[$this->param['search_type']] = ['like', "%{$this->param['search']}%"];
63 } 63 }
  64 + if(isset($param['zone_id']) && !empty($param['zone_id'])){
  65 + $map['channel'] = ['like','%"zone_id": "'.$this->map['zone_id'].'"%'];
  66 + }
  67 + if(isset($param['channel_id']) && !empty($param['channel_id'])){
  68 + $map['channel'] = ['like','%"channel_id": "'.$this->map['channel_id'].'"%'];
  69 + }
  70 + if(isset($param['user_id']) && !empty($param['user_id'])){
  71 + $map['channel'] = ['like','%"user_id": "'.$this->map['user_id'].'"%'];
  72 + }
64 //按类型搜索 73 //按类型搜索
65 $map['delete_status'] = 0; 74 $map['delete_status'] = 0;
66 if(empty($param['type'])){ 75 if(empty($param['type'])){
@@ -25,7 +25,7 @@ class ATemplateController extends BaseController @@ -25,7 +25,7 @@ class ATemplateController extends BaseController
25 */ 25 */
26 public function lists(ATemplateLogic $aTemplateLogic){ 26 public function lists(ATemplateLogic $aTemplateLogic){
27 $templateLabel = new TemplateLabel(); 27 $templateLabel = new TemplateLabel();
28 - $this->searchLabelName($templateLabel); 28 + $this->map = $this->searchLabelName($templateLabel);
29 $filed = ['id','name','image','url','status','sort','deleted_status','test_model','created_at','project_id']; 29 $filed = ['id','name','image','url','status','sort','deleted_status','test_model','created_at','project_id'];
30 $lists = $aTemplateLogic->aTemplateList($this->map,$this->page,$this->row,$this->order,$filed); 30 $lists = $aTemplateLogic->aTemplateList($this->map,$this->page,$this->row,$this->order,$filed);
31 if(!empty($lists) && !empty($lists['list'])){ 31 if(!empty($lists) && !empty($lists['list'])){
@@ -51,7 +51,7 @@ class ATemplateController extends BaseController @@ -51,7 +51,7 @@ class ATemplateController extends BaseController
51 $this->map['id'] = ['in',$id_arr]; 51 $this->map['id'] = ['in',$id_arr];
52 unset($this->map['label_name']); 52 unset($this->map['label_name']);
53 } 53 }
54 - return true; 54 + return $this->map;
55 } 55 }
56 56
57 /** 57 /**
@@ -28,7 +28,7 @@ class ATemplateModuleController extends BaseController @@ -28,7 +28,7 @@ class ATemplateModuleController extends BaseController
28 public function lists(TemplateModule $templateModule){ 28 public function lists(TemplateModule $templateModule){
29 $templateLabel = new TemplateLabel(); 29 $templateLabel = new TemplateLabel();
30 $this->map['deleted_status'] = 0; 30 $this->map['deleted_status'] = 0;
31 - $this->searchLabelName($templateLabel); 31 + $this->map = $this->searchLabelName($templateLabel);
32 $lists = $templateModule->lists($this->map,$this->page,$this->row,$this->order); 32 $lists = $templateModule->lists($this->map,$this->page,$this->row,$this->order);
33 if(!empty($lists) && !empty($lists['list'])){ 33 if(!empty($lists) && !empty($lists['list'])){
34 foreach ($lists['list'] as $k => $v){ 34 foreach ($lists['list'] as $k => $v){
@@ -52,7 +52,7 @@ class ATemplateModuleController extends BaseController @@ -52,7 +52,7 @@ class ATemplateModuleController extends BaseController
52 $this->map['id'] = ['in',$id_arr]; 52 $this->map['id'] = ['in',$id_arr];
53 unset($this->map['label_name']); 53 unset($this->map['label_name']);
54 } 54 }
55 - return true; 55 + return $this->map;
56 } 56 }
57 57
58 58
@@ -49,7 +49,6 @@ class TicketController extends BaseController @@ -49,7 +49,6 @@ class TicketController extends BaseController
49 ],[ 49 ],[
50 'dept_id.required' => '技术组id', 50 'dept_id.required' => '技术组id',
51 ]); 51 ]);
52 - $this->order = 'ticket_num';  
53 $sort = $this->map['sort'] ?? 'desc'; 52 $sort = $this->map['sort'] ?? 'desc';
54 $data = $this->logic->getManageTicketCount($this->map,$this->order,$sort); 53 $data = $this->logic->getManageTicketCount($this->map,$this->order,$sort);
55 $this->response('success',Code::SUCCESS,$data); 54 $this->response('success',Code::SUCCESS,$data);
@@ -88,7 +88,7 @@ class AsideTicketLogController extends BaseController @@ -88,7 +88,7 @@ class AsideTicketLogController extends BaseController
88 { 88 {
89 // 如果所有子任务都完成了,则将工单状态改为已完成 89 // 如果所有子任务都完成了,则将工单状态改为已完成
90 // todo 注意:建站期间的工单,所有人都完成后,不自动完成工单,需要项目经理验收修改工单状态 90 // todo 注意:建站期间的工单,所有人都完成后,不自动完成工单,需要项目经理验收修改工单状态
91 - if (!($ticket->project->status == 1 && in_array($ticket->project->project_cate, [1, 2]))) 91 + if (($ticket->title == 'GEO项目') || !($ticket->project->status == 1 && in_array($ticket->project->project_cate, [1, 2])))
92 { 92 {
93 $ticket->status = Tickets::STATUS_COMPLETED; 93 $ticket->status = Tickets::STATUS_COMPLETED;
94 $ticket->end_at = now(); 94 $ticket->end_at = now();
@@ -109,7 +109,7 @@ class AyrShareController extends BaseController @@ -109,7 +109,7 @@ class AyrShareController extends BaseController
109 'id.required' => 'ID不能为空' 109 'id.required' => 'ID不能为空'
110 ]); 110 ]);
111 $info = $ayrShareLogic->ayr_share_info(); 111 $info = $ayrShareLogic->ayr_share_info();
112 - if(!empty($info['title'])){ 112 + if(!empty($info['profile_key'])){
113 $data = [ 113 $data = [
114 // 'title'=>$info['title'], 114 // 'title'=>$info['title'],
115 'profileKey'=>$info['profile_key'] 115 'profileKey'=>$info['profile_key']
@@ -117,4 +117,16 @@ class GeoQuestionResController extends BaseController @@ -117,4 +117,16 @@ class GeoQuestionResController extends BaseController
117 $data = $this->logic->getSearchDate(); 117 $data = $this->logic->getSearchDate();
118 $this->response('success',Code::SUCCESS,$data); 118 $this->response('success',Code::SUCCESS,$data);
119 } 119 }
  120 +
  121 + /**
  122 + * @remark :获取当前项目所有标签
  123 + * @name :getLabel
  124 + * @author :lyh
  125 + * @method :post
  126 + * @time :2025/8/19 16:39
  127 + */
  128 + public function getLabel(){
  129 + $data = $this->logic->getLabelData();
  130 + $this->response('success',Code::SUCCESS,$data);
  131 + }
120 } 132 }
@@ -88,11 +88,11 @@ class GeoLogic extends BaseLogic @@ -88,11 +88,11 @@ class GeoLogic extends BaseLogic
88 $this->param['url'] = json_encode($this->param['url'] ?? [],true); 88 $this->param['url'] = json_encode($this->param['url'] ?? [],true);
89 $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true); 89 $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
90 //执行时间设置为今天 90 //执行时间设置为今天
91 - $this->param['next_time'] = date('Y-m-d');  
92 if(isset($this->param['id']) && !empty($this->param['id'])){ 91 if(isset($this->param['id']) && !empty($this->param['id'])){
93 $id = $this->param['id']; 92 $id = $this->param['id'];
94 $this->model->edit($this->param,['id'=>$id]); 93 $this->model->edit($this->param,['id'=>$id]);
95 }else{ 94 }else{
  95 + $this->param['next_time'] = date('Y-m-d');
96 $id = $this->model->addReturnId($this->param); 96 $id = $this->model->addReturnId($this->param);
97 } 97 }
98 return $this->success(['id'=>$id]); 98 return $this->success(['id'=>$id]);
@@ -34,7 +34,6 @@ class AggregateKeywordLogic extends BaseLogic @@ -34,7 +34,6 @@ class AggregateKeywordLogic extends BaseLogic
34 $this->param['id'] = $this->model->addReturnId($this->param); 34 $this->param['id'] = $this->model->addReturnId($this->param);
35 // 添加预设功能 同步关键词 迁入到 namespace App\Console\Commands\Product\SetKeywordSync 35 // 添加预设功能 同步关键词 迁入到 namespace App\Console\Commands\Product\SetKeywordSync
36 } 36 }
37 -  
38 return $this->success(['id'=>$this->param['id']]); 37 return $this->success(['id'=>$this->param['id']]);
39 } 38 }
40 39
@@ -61,10 +61,11 @@ class TicketLogic extends BaseLogic @@ -61,10 +61,11 @@ class TicketLogic extends BaseLogic
61 $dailyModel = new TicketDailyCount(); 61 $dailyModel = new TicketDailyCount();
62 $dailyList = $dailyModel->list([],'date',['*'],'desc',5);//取最近5条数据 62 $dailyList = $dailyModel->list([],'date',['*'],'desc',5);//取最近5条数据
63 $manageModel = new TicketDailyManageCount(); 63 $manageModel = new TicketDailyManageCount();
64 - $manageList = $manageModel->list(['date'=>$date,'ticket_num'=>['!=',0],'average_time'=>['!=','']],'average_time',['*'],'asc',5);//取最近5条数据 64 + $manageList = $manageModel->list(['dept_id'=>1,'date'=>$date,'ticket_num'=>['!=',0],'average_time'=>['!=','']],'average_time',['*'],'asc');
  65 + $manage2List = $manageModel->list(['dept_id'=>2,'date'=>$date,'ticket_num'=>['!=',0],'average_time'=>['!=','']],'average_time',['*'],'asc');
65 $deptModel = new TicketDailyDeptCount(); 66 $deptModel = new TicketDailyDeptCount();
66 - $deptList = $deptModel->list(['date'=>$date,'ticket_num'=>['!=',0]],'average_time',['*'],'asc',5);  
67 - $data = ['daily'=>$dailyList,'manage'=>$manageList,'dept'=>$deptList]; 67 + $deptList = $deptModel->list(['date'=>$date,'ticket_num'=>['!=',0]],'average_time',['*'],'asc');
  68 + $data = ['daily'=>$dailyList,'manage'=>$manageList,'manage2'=>$manage2List,'dept'=>$deptList];
68 return $this->success($data); 69 return $this->success($data);
69 } 70 }
70 71
@@ -48,19 +48,22 @@ class GeoQuestionResLogic extends BaseLogic @@ -48,19 +48,22 @@ class GeoQuestionResLogic extends BaseLogic
48 */ 48 */
49 public function getResultList($map = [],$page = 1,$row = 20){ 49 public function getResultList($map = [],$page = 1,$row = 20){
50 $map['project_id'] = $this->user['project_id']; 50 $map['project_id'] = $this->user['project_id'];
51 - $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','created_at','updated_at']; 51 + $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','label','created_at','updated_at'];
52 if(!empty($map['created_at'])){ 52 if(!empty($map['created_at'])){
53 $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']]; 53 $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']];
54 $this->model = new GeoQuestionLog(); 54 $this->model = new GeoQuestionLog();
55 } 55 }
  56 + if(isset($map['label']) && !empty($map['label'])){
  57 + $map['label'] = ['like','%'.$map['label'].'%'];
  58 + }
56 if(!empty($map['keywords'])){ 59 if(!empty($map['keywords'])){
57 $map['keywords'] = ['like','%'.$map['keywords'].'%']; 60 $map['keywords'] = ['like','%'.$map['keywords'].'%'];
58 } 61 }
59 $query = $this->model->formatQuery($map); 62 $query = $this->model->formatQuery($map);
60 - $query = $query->where(function ($q) {  
61 - $q->whereRaw('JSON_LENGTH(keywords) > 0')  
62 - ->orWhereRaw('JSON_LENGTH(url) > 0');  
63 - }); 63 +// $query = $query->where(function ($q) {
  64 +// $q->whereRaw('JSON_LENGTH(keywords) > 0')
  65 +// ->orWhereRaw('JSON_LENGTH(url) > 0');
  66 +// });
64 $data = $query->orderByRaw('CHAR_LENGTH(question) ASC')->paginate($row, $filed, 'page', $page);; 67 $data = $query->orderByRaw('CHAR_LENGTH(question) ASC')->paginate($row, $filed, 'page', $page);;
65 return $this->success($data); 68 return $this->success($data);
66 } 69 }
@@ -87,12 +90,17 @@ class GeoQuestionResLogic extends BaseLogic @@ -87,12 +90,17 @@ class GeoQuestionResLogic extends BaseLogic
87 public function countQuantity(){ 90 public function countQuantity(){
88 $questionModel = new GeoQuestion(); 91 $questionModel = new GeoQuestion();
89 $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']); 92 $list = $questionModel->list(['project_id'=>$this->user['project_id']],['question','keywords','url']);
90 - $questionTotalCount = $urlTotalCount = $keywordsTotalCount = $keywordUrlCount = 0; 93 + $core_question_count = $questionTotalCount = $urlTotalCount = $keywordsTotalCount = 0;
91 $keywordArr = []; 94 $keywordArr = [];
92 $questionLogModel = new GeoQuestionLog(); 95 $questionLogModel = new GeoQuestionLog();
93 $keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]); 96 $keywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'hit'=>['!=',0]]);
  97 + $coreKeywordUrlCount = $questionLogModel->counts(['project_id'=>$this->user['project_id'],'label'=>['like','%核心问题%'],'hit'=>['!=',0]]);
94 foreach ($list as $item){ 98 foreach ($list as $item){
95 $questionTotalCount += count($item['question'] ?? []); 99 $questionTotalCount += count($item['question'] ?? []);
  100 + //核心问题数
  101 + if(strpos($item['label'],'核心问题') !== false){
  102 + $core_question_count += count($item['question'] ?? []);
  103 + }
96 $keywordsTotalCount += count($item['keywords'] ?? []); 104 $keywordsTotalCount += count($item['keywords'] ?? []);
97 $urlTotalCount += count($item['url'] ?? []); 105 $urlTotalCount += count($item['url'] ?? []);
98 foreach ($item['keywords'] as $keyWordItem){ 106 foreach ($item['keywords'] as $keyWordItem){
@@ -107,6 +115,8 @@ class GeoQuestionResLogic extends BaseLogic @@ -107,6 +115,8 @@ class GeoQuestionResLogic extends BaseLogic
107 'question_count'=>$questionTotalCount, 115 'question_count'=>$questionTotalCount,
108 'keywords_url_count'=>$keywordUrlCount, 116 'keywords_url_count'=>$keywordUrlCount,
109 'keywords_arr' => $keywordArr, 117 'keywords_arr' => $keywordArr,
  118 + 'core_question_count'=>$core_question_count,
  119 + 'core_keyword_url_count'=>$coreKeywordUrlCount
110 ]; 120 ];
111 return $this->success($data); 121 return $this->success($data);
112 } 122 }
@@ -141,4 +151,21 @@ class GeoQuestionResLogic extends BaseLogic @@ -141,4 +151,21 @@ class GeoQuestionResLogic extends BaseLogic
141 return $this->success($dates); 151 return $this->success($dates);
142 } 152 }
143 153
  154 + /**
  155 + * @remark :获取标签列表
  156 + * @name :getLabelData
  157 + * @author :lyh
  158 + * @method :post
  159 + * @time :2025/8/19 16:42
  160 + */
  161 + public function getLabelData(){
  162 + $questionModel = new GeoQuestion();
  163 + $labelArr = $questionModel->selectField(['project_id'=>$this->user['project_id']],'label');
  164 + $data = [];
  165 + foreach ($labelArr as $item){
  166 + $arr = explode("\r\n",$item);
  167 + $data = array_values(array_unique(array_merge($arr,$data)));
  168 + }
  169 + return $this->success($data);
  170 + }
144 } 171 }
@@ -142,7 +142,6 @@ class KeywordLogic extends BaseLogic @@ -142,7 +142,6 @@ class KeywordLogic extends BaseLogic
142 $this->fail('保存失败,请联系管理员'); 142 $this->fail('保存失败,请联系管理员');
143 } 143 }
144 Common::del_user_cache('product_keyword',$this->user['project_id']); 144 Common::del_user_cache('product_keyword',$this->user['project_id']);
145 - NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD, ['project_id' => $this->user['project_id']]);  
146 return $this->success(); 145 return $this->success();
147 } 146 }
148 147
@@ -345,6 +345,11 @@ class ProductLogic extends BaseLogic @@ -345,6 +345,11 @@ class ProductLogic extends BaseLogic
345 }else{ 345 }else{
346 $param['category_id'] = ''; 346 $param['category_id'] = '';
347 } 347 }
  348 + if(isset($param['og_image']) && !empty($param['og_image'])){
  349 + $param['og_image'] = str_replace_url($param['og_image'] ?? '');
  350 + }else{
  351 + $param['og_image'] = $param['gallery'][0]['url'] ?? '';
  352 + }
348 //产品图 353 //产品图
349 if(isset($param['gallery']) && !empty($param['gallery'])){ 354 if(isset($param['gallery']) && !empty($param['gallery'])){
350 foreach ($param['gallery'] as $k => $v){ 355 foreach ($param['gallery'] as $k => $v){
@@ -357,11 +362,6 @@ class ProductLogic extends BaseLogic @@ -357,11 +362,6 @@ class ProductLogic extends BaseLogic
357 $param['thumb'] = Arr::a2s([]); 362 $param['thumb'] = Arr::a2s([]);
358 $param['gallery'] = Arr::a2s([]); 363 $param['gallery'] = Arr::a2s([]);
359 } 364 }
360 - if(isset($param['og_image']) && !empty($param['og_image'])){  
361 - $param['og_image'] = str_replace_url($param['og_image'] ?? '');  
362 - }else{  
363 - $param['og_image'] = $param['thumb']['url'] ?? '';  
364 - }  
365 if(isset($param['files'])){ 365 if(isset($param['files'])){
366 $param['files']['url'] = str_replace_url($param['files']['url'] ?? ''); 366 $param['files']['url'] = str_replace_url($param['files']['url'] ?? '');
367 $param['files'] = Arr::a2s($param['files'] ?? []); 367 $param['files'] = Arr::a2s($param['files'] ?? []);
@@ -67,7 +67,7 @@ class RankDataLogic extends BaseLogic @@ -67,7 +67,7 @@ class RankDataLogic extends BaseLogic
67 $speed = Speed::where('project_id', $project_id)->first(); 67 $speed = Speed::where('project_id', $project_id)->first();
68 //暂停优化的项目(排名数据显示横杠 - ,关键词排名第一页 、 关键词排名前十页 、 Google收录页面数 、 可查询外链数) 68 //暂停优化的项目(排名数据显示横杠 - ,关键词排名第一页 、 关键词排名前十页 、 Google收录页面数 、 可查询外链数)
69 if(!empty($project['level'])){ 69 if(!empty($project['level'])){
70 - if (in_array('2', $project['level']) || in_array('3', $project['level'])) { 70 + if (in_array('2', $project['level'])) {// || in_array('3', $project['level'])
71 $rank['first_page_num'] = $rank['first_ten_pages_num'] = $rank['indexed_pages_num'] = $external_links['total'] = '-'; 71 $rank['first_page_num'] = $rank['first_ten_pages_num'] = $rank['indexed_pages_num'] = $external_links['total'] = '-';
72 } 72 }
73 } 73 }
@@ -555,7 +555,7 @@ class RankDataLogic extends BaseLogic @@ -555,7 +555,7 @@ class RankDataLogic extends BaseLogic
555 $without_extension_project_ids = [658]; //是否达标只统计主词的 555 $without_extension_project_ids = [658]; //是否达标只统计主词的
556 $extension_project_ids = [354]; //扩展词也到达标的 556 $extension_project_ids = [354]; //扩展词也到达标的
557 $compliance_project_ids = [2163,257,823,1750,497]; //直接达标处理的 557 $compliance_project_ids = [2163,257,823,1750,497]; //直接达标处理的
558 - $ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685,3309];//暂停的项目 558 + $ceaseProjectId = [354, 378, 649, 1226, 1283, 1703, 1893, 2066, 2250,2193,2399,1685];//暂停的项目
559 $uptimeProjectId = [1434,1812,276,2414,2974];//按上线时间统计的项目 559 $uptimeProjectId = [1434,1812,276,2414,2974];//按上线时间统计的项目
560 //一个项目多个api_no 560 //一个项目多个api_no
561 $multiple_api_no_project_ids = [ 561 $multiple_api_no_project_ids = [
@@ -145,7 +145,7 @@ class DomainSettingLogic extends BaseLogic @@ -145,7 +145,7 @@ class DomainSettingLogic extends BaseLogic
145 145
146 //变更ip使用数量 146 //变更ip使用数量
147 $server_ip_model->edit(['total' => $record_info['total'] + 1], ['id' => $record_info['id']]); 147 $server_ip_model->edit(['total' => $record_info['total'] + 1], ['id' => $record_info['id']]);
148 - $server_model->edit(['being_number' => $record_info['total'] + 1], ['id' => $record_info['servers_id']]); 148 + $server_model->where(['id'=>$record_info['servers_id']])->increment('being_number',1);
149 149
150 //创建建站任务 150 //创建建站任务
151 $domain_create_model = new DomainCreateTask(); 151 $domain_create_model = new DomainCreateTask();
@@ -204,7 +204,7 @@ class DomainSettingLogic extends BaseLogic @@ -204,7 +204,7 @@ class DomainSettingLogic extends BaseLogic
204 204
205 //变更ip使用数量 205 //变更ip使用数量
206 $server_ip_model->edit(['total' => $record_info['total'] + 1], ['id' => $record_info['id']]); 206 $server_ip_model->edit(['total' => $record_info['total'] + 1], ['id' => $record_info['id']]);
207 - $server_model->edit(['being_number' => $record_info['total'] + 1], ['id' => $record_info['servers_id']]); 207 + $server_model->where(['id'=>$record_info['servers_id']])->increment('being_number',1);
208 } 208 }
209 209
210 DB::commit(); 210 DB::commit();
@@ -64,7 +64,8 @@ class Channel extends Base @@ -64,7 +64,8 @@ class Channel extends Base
64 return $sales_id; 64 return $sales_id;
65 } 65 }
66 $channel_alias = self::where('id', $user['channel_id'])->value('alias'); 66 $channel_alias = self::where('id', $user['channel_id'])->value('alias');
67 - $channel_alias = $channel_alias . '-' . $user['name']; 67 + $channel_mobile = self::where('id', $user['channel_id'])->value('contact_mobile');
  68 + $channel_alias = $channel_alias . '-' . $user['name'].'-'.$channel_mobile;
68 Cache::put('channel_alias_'.$sales_id,$channel_alias,24 * 3600); 69 Cache::put('channel_alias_'.$sales_id,$channel_alias,24 * 3600);
69 } 70 }
70 return $channel_alias; 71 return $channel_alias;
@@ -79,6 +79,7 @@ class Project extends Base @@ -79,6 +79,7 @@ class Project extends Base
79 3=>'2-4', 79 3=>'2-4',
80 4=>'3-5', 80 4=>'3-5',
81 5=>'5-7', 81 5=>'5-7',
  82 + 6=>'1/2'
82 ]; 83 ];
83 if($val){ 84 if($val){
84 return $arr[$val] ?? ''; 85 return $arr[$val] ?? '';
@@ -29,6 +29,7 @@ class MessagePush extends Base @@ -29,6 +29,7 @@ class MessagePush extends Base
29 const TYPE_WEEK = 'week'; 29 const TYPE_WEEK = 'week';
30 const TYPE_TICKET = 'Ticket'; 30 const TYPE_TICKET = 'Ticket';
31 const TYPE_DOMAIN = 'domain'; 31 const TYPE_DOMAIN = 'domain';
  32 + const TYPE_DOMAIN_V5 = 'domain_v5';
32 //设置关联表名 33 //设置关联表名
33 /** 34 /**
34 * @var mixed 35 * @var mixed
@@ -103,9 +103,10 @@ return [ @@ -103,9 +103,10 @@ return [
103 ], 103 ],
104 //域名解析别处记录日志 104 //域名解析别处记录日志
105 'analyze_other' => [ 105 'analyze_other' => [
106 - 'driver' => 'custom',  
107 - 'via' => \App\Factory\LogFormatterFactory::class,  
108 - 'prefix' => 'analyze_other', 106 + 'driver' => 'daily',
  107 + 'path' => storage_path('logs/analyze_other/laravel.log'),
  108 + 'level' => 'debug',
  109 + 'days' => 14,
109 ], 110 ],
110 'stack' => [ 111 'stack' => [
111 'driver' => 'stack', 112 'driver' => 'stack',
@@ -328,8 +328,9 @@ Route::middleware(['aloginauth'])->group(function () { @@ -328,8 +328,9 @@ Route::middleware(['aloginauth'])->group(function () {
328 Route::any('/saveAiPrefix', [Aside\Optimize\OptimizeController::class, 'saveAiPrefix'])->name('admin.optimize_saveAiPrefix');//保存Ai前后缀 328 Route::any('/saveAiPrefix', [Aside\Optimize\OptimizeController::class, 'saveAiPrefix'])->name('admin.optimize_saveAiPrefix');//保存Ai前后缀
329 Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关 329 Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关
330 Route::any('/editBacklink', [Aside\Optimize\OptimizeController::class, 'editBacklink'])->name('admin.optimize_editBacklink');//设置backlink开关 330 Route::any('/editBacklink', [Aside\Optimize\OptimizeController::class, 'editBacklink'])->name('admin.optimize_editBacklink');//设置backlink开关
331 - Route::any('/setAiVideo', [Aside\Optimize\OptimizeController::class, 'setAiVideo'])->name('admin.optimize_setAiVideo');//设置backlink开关  
332 - Route::any('/anchorTextList', [Aside\Optimize\OptimizeController::class, 'anchorTextList'])->name('admin.optimize_anchorTextList');//设置backlink开关 331 + Route::any('/setAiVideo', [Aside\Optimize\OptimizeController::class, 'setAiVideo'])->name('admin.optimize_setAiVideo');//设置ai_video
  332 + Route::any('/anchorTextList', [Aside\Optimize\OptimizeController::class, 'anchorTextList'])->name('admin.optimize_anchorTextList');//锚文本链接
  333 + Route::any('/getKeywordRouteList', [Aside\Optimize\OptimizeController::class, 'getKeywordRouteList'])->name('admin.optimize_getKeywordRouteList');//聚合页链接
333 Route::any('/saveMinorLanguages', [Aside\Optimize\OptimizeController::class, 'saveMinorLanguages'])->name('admin.optimize_saveMinorLanguages');//设置小语种监控开关 334 Route::any('/saveMinorLanguages', [Aside\Optimize\OptimizeController::class, 'saveMinorLanguages'])->name('admin.optimize_saveMinorLanguages');//设置小语种监控开关
334 Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关 335 Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关
335 Route::any('/getAnchorLink', [Aside\Optimize\OptimizeController::class, 'getAnchorLink'])->name('admin.optimize_getAnchorLink');//设置robots开关 336 Route::any('/getAnchorLink', [Aside\Optimize\OptimizeController::class, 'getAnchorLink'])->name('admin.optimize_getAnchorLink');//设置robots开关
@@ -754,6 +754,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -754,6 +754,7 @@ Route::middleware(['bloginauth'])->group(function () {
754 Route::prefix('geo_result')->group(function () { 754 Route::prefix('geo_result')->group(function () {
755 Route::any('/getList', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getList'])->name('geo_result_getList'); 755 Route::any('/getList', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getList'])->name('geo_result_getList');
756 Route::any('/getInfo', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getInfo'])->name('geo_result_getInfo'); 756 Route::any('/getInfo', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getInfo'])->name('geo_result_getInfo');
  757 + Route::any('/getLabel', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class,'getLabel'])->name('geo_result_getLabel');
757 Route::any('/getType', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getType'])->name('geo_result_getType');//geo设置类型 758 Route::any('/getType', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getType'])->name('geo_result_getType');//geo设置类型
758 Route::any('/getCount', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getCount'])->name('geo_result_getCount');//geo设置类型统计数量 759 Route::any('/getCount', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'getCount'])->name('geo_result_getCount');//geo设置类型统计数量
759 Route::any('/countQuantity', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'countQuantity'])->name('geo_result_countQuantity');//geo统计 760 Route::any('/countQuantity', [\App\Http\Controllers\Bside\Geo\GeoQuestionResController::class, 'countQuantity'])->name('geo_result_countQuantity');//geo统计