作者 ZhengBing He

Merge remote-tracking branch 'origin/lyh-server' into workorder

@@ -63,7 +63,7 @@ class AiVideoAutoPublish extends Command @@ -63,7 +63,7 @@ class AiVideoAutoPublish extends Command
63 } 63 }
64 64
65 /** 65 /**
66 - * @remark :普通项目--自动发布 66 + * @remark :自动发布aiVideo组装数据(写入一条记录)
67 * @name :auto_six_publish 67 * @name :auto_six_publish
68 * @author :lyh 68 * @author :lyh
69 * @method :post 69 * @method :post
@@ -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,'id'=>1,'delete_status'=>0,'site_status'=>0,'extend_type'=>0],'id',['id','project_type']); 76 + $projectList = $projectModel->list(['is_ai_video'=>1,'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
@@ -129,10 +129,7 @@ class AiVideoAutoPublish extends Command @@ -129,10 +129,7 @@ class AiVideoAutoPublish extends Command
129 return $data; 129 return $data;
130 } 130 }
131 $data['title'] = $info['title']; 131 $data['title'] = $info['title'];
132 - $data['remark'] = strip_tags($info['intro']);  
133 - if(empty($data['remark'])){  
134 - $data['remark'] = $data['title'];  
135 - } 132 + $data['remark'] = $info['intro'];
136 $data['images'] = array_filter(array_map(function ($item) use ($data) { 133 $data['images'] = array_filter(array_map(function ($item) use ($data) {
137 if (!empty($item['url'])) { 134 if (!empty($item['url'])) {
138 return [ 135 return [
@@ -193,7 +190,6 @@ class AiVideoAutoPublish extends Command @@ -193,7 +190,6 @@ class AiVideoAutoPublish extends Command
193 } 190 }
194 $item = $aiVideoAutoLogModel->read(['status'=>0,'trigger_id'=>null]); 191 $item = $aiVideoAutoLogModel->read(['status'=>0,'trigger_id'=>null]);
195 if($item === false){ 192 if($item === false){
196 - echo date('Y-m-d H:i:s').':无生成图片的数据。'.PHP_EOL;  
197 sleep(60); 193 sleep(60);
198 continue; 194 continue;
199 } 195 }
@@ -204,7 +200,7 @@ class AiVideoAutoPublish extends Command @@ -204,7 +200,7 @@ class AiVideoAutoPublish extends Command
204 $midJourneyService = new MidJourneyService(); 200 $midJourneyService = new MidJourneyService();
205 $result = $midJourneyService->imagine($content); 201 $result = $midJourneyService->imagine($content);
206 if($result && !empty($result['trigger_id'])){ 202 if($result && !empty($result['trigger_id'])){
207 - echo '提交的数据详情。'.json_encode($result,true).$item['project_id'].PHP_EOL; 203 + echo '提交的数据详情。'.json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).$item['project_id'].PHP_EOL;
208 Redis::incr('ai_video_image'); 204 Redis::incr('ai_video_image');
209 $aiVideoAutoLogModel->edit(['trigger_id'=>$result['trigger_id']],['id'=>$item['id']]); 205 $aiVideoAutoLogModel->edit(['trigger_id'=>$result['trigger_id']],['id'=>$item['id']]);
210 } 206 }
@@ -241,14 +237,17 @@ class AiVideoAutoPublish extends Command @@ -241,14 +237,17 @@ class AiVideoAutoPublish extends Command
241 $aiVideoService = new AiVideoService($info['project_id']); 237 $aiVideoService = new AiVideoService($info['project_id']);
242 $projectModel = new DeployOptimize(); 238 $projectModel = new DeployOptimize();
243 $video_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'video_setting'); 239 $video_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'video_setting');
  240 + $frequency_setting = $projectModel->getValue(['project_id'=>$info['project_id']],'send_ai_video_frequency');
244 $storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1]; 241 $storage = $aiVideoTaskModel->videoSetting()[$video_setting ?? 1];
  242 + $frequency = $aiVideoTaskModel->videoFrequency()[$frequency_setting ?? 1];
  243 + $frequencyArr = explode('-',$frequency);
245 $result = $aiVideoService->createTask($info['title'],$info['remark'],$info['images'],[],$storage); 244 $result = $aiVideoService->createTask($info['title'],$info['remark'],$info['images'],[],$storage);
246 if($result['status'] == 200){ 245 if($result['status'] == 200){
247 - $aiVideoTaskModel->addReturnId(['task_id'=>$result['data']['task_id'],'project_id'=>$info['project_id'],'storage'=>$storage]); 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]);
248 ProjectServer::useProject($info['project_id']); 248 ProjectServer::useProject($info['project_id']);
249 $aiVideoModel = new AiVideo(); 249 $aiVideoModel = new AiVideo();
250 - $next_auto_date = date('Y-m-d', strtotime('+' . mt_rand(5,7) . 'days')); //每5-7天自动发布  
251 - $aiVideoModel->addReturnId(['next_auto_date'=>$next_auto_date,'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)]);
252 DB::disconnect('custom_mysql'); 251 DB::disconnect('custom_mysql');
253 $aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]); 252 $aiVideoAutoLogModel->edit(['status'=>2],['id'=>$info['id']]);
254 } 253 }
@@ -289,7 +288,7 @@ class AiVideoAutoPublish extends Command @@ -289,7 +288,7 @@ class AiVideoAutoPublish extends Command
289 * @method :post 288 * @method :post
290 * @time :2025/8/1 16:25 289 * @time :2025/8/1 16:25
291 */ 290 */
292 - public function getAiVideoParam($project_id = 3751) 291 + public function getAiVideoParam($project_id)
293 { 292 {
294 //获取当前网站域名 293 //获取当前网站域名
295 $domainModel = new DomainInfo(); 294 $domainModel = new DomainInfo();
@@ -81,69 +81,86 @@ class DomainInfo extends Command @@ -81,69 +81,86 @@ class DomainInfo extends Command
81 continue; 81 continue;
82 } 82 }
83 83
84 - //除自建站项目外,记录已解析到别的ip的域名  
85 - if ($servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) {  
86 - //过滤已解析到别的ip的域名 84 + if ($servers_ip_info['servers_id'] == ServerConfig::SELF_SITE_ID) {
  85 + //自建站项目,直接获取主站证书有效期并更新
  86 + $ssl_time = $this->getDomainSslTime($v['domain']);
  87 + if ($ssl_time['from'] && $ssl_time['to']) {
  88 + $v->certificate_start_time = $ssl_time['from'];
  89 + $v->certificate_end_time = $ssl_time['to'];
  90 + $v->save();
  91 + }
  92 +
  93 + if (empty($v['domain_end_time']) || $v['domain_end_time'] < date('Y-m-d H:i:s')) {
  94 + //获取主站域名有效期并更新
  95 + $valid_time = $this->getDomainValidTime($v['domain']);
  96 + if ($valid_time['start'] && $valid_time['end']) {
  97 + $v->domain_start_time = $valid_time['start'];
  98 + $v->domain_end_time = $valid_time['end'];
  99 + $v->save();
  100 + }
  101 + }
  102 + } else {
  103 + //除自建站项目外,记录已解析到别的ip的域名
87 if (!check_domain_record($v['domain'], $servers_ip_info)) { 104 if (!check_domain_record($v['domain'], $servers_ip_info)) {
88 Log::channel('analyze_other')->error('域名 [' . $v['domain'] . '] 已解析到别的IP'); 105 Log::channel('analyze_other')->error('域名 [' . $v['domain'] . '] 已解析到别的IP');
89 continue; 106 continue;
90 } 107 }
91 - }  
92 108
93 - //判断是否已经建站  
94 - if ($project_info['project_type'] == Project::PROJECT_TYPE_SEO) {  
95 - $type = DomainCreateTask::TYPE_BLOG;  
96 - } else {  
97 - $type = DomainCreateTask::TYPE_MAIN;  
98 - }  
99 - $task_info = $domainCreateTaskModel->read(['type' => $type, 'domain_id' => $v['id'], 'status' => DomainCreateTask::STATUS_SUC], ['id']);  
100 - if (!$task_info) {  
101 - continue;  
102 - }  
103 -  
104 - //获取主站证书有效期并更新  
105 - $ssl_time = $this->getDomainSslTime($v['domain']);  
106 - if ($ssl_time['from'] && $ssl_time['to']) {  
107 - $v->certificate_start_time = $ssl_time['from'];  
108 - $v->certificate_end_time = $ssl_time['to'];  
109 - $v->save();  
110 - } 109 + //判断是否已经建站
  110 + if ($project_info['project_type'] == Project::PROJECT_TYPE_SEO) {
  111 + $type = DomainCreateTask::TYPE_BLOG;
  112 + } else {
  113 + $type = DomainCreateTask::TYPE_MAIN;
  114 + }
  115 + $task_info = $domainCreateTaskModel->read(['type' => $type, 'domain_id' => $v['id'], 'status' => DomainCreateTask::STATUS_SUC], ['id']);
  116 + if (!$task_info) {
  117 + continue;
  118 + }
111 119
112 - if (empty($v['domain_end_time']) || $v['domain_end_time'] < date('Y-m-d H:i:s')) {  
113 - //获取主站域名有效期并更新  
114 - $valid_time = $this->getDomainValidTime($v['domain']);  
115 - if ($valid_time['start'] && $valid_time['end']) {  
116 - $v->domain_start_time = $valid_time['start'];  
117 - $v->domain_end_time = $valid_time['end']; 120 + //获取主站证书有效期并更新
  121 + $ssl_time = $this->getDomainSslTime($v['domain']);
  122 + if ($ssl_time['from'] && $ssl_time['to']) {
  123 + $v->certificate_start_time = $ssl_time['from'];
  124 + $v->certificate_end_time = $ssl_time['to'];
118 $v->save(); 125 $v->save();
119 } 126 }
120 - }  
121 127
122 - if ($v['amp_status'] == 1) {  
123 - $domain_array = parse_url($v['domain']);  
124 - $host = $domain_array['host'] ?? $domain_array['path'];  
125 - $host_array = explode('.', $host);  
126 - if (count($host_array) <= 2) {  
127 - array_unshift($host_array, 'm');  
128 - } else {  
129 - $host_array[0] = 'm'; 128 + if (empty($v['domain_end_time']) || $v['domain_end_time'] < date('Y-m-d H:i:s')) {
  129 + //获取主站域名有效期并更新
  130 + $valid_time = $this->getDomainValidTime($v['domain']);
  131 + if ($valid_time['start'] && $valid_time['end']) {
  132 + $v->domain_start_time = $valid_time['start'];
  133 + $v->domain_end_time = $valid_time['end'];
  134 + $v->save();
  135 + }
130 } 136 }
131 - $amp_domain = implode('.', $host_array);  
132 137
133 - if ($servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) {  
134 - //过滤已解析到别的ip的AMP域名  
135 - if (!check_domain_record($amp_domain, $servers_ip_info)) {  
136 - Log::channel('analyze_other')->error('AMP域名 [' . $amp_domain . '] 已解析到别的IP');  
137 - continue; 138 + if ($v['amp_status'] == 1) {
  139 + $domain_array = parse_url($v['domain']);
  140 + $host = $domain_array['host'] ?? $domain_array['path'];
  141 + $host_array = explode('.', $host);
  142 + if (count($host_array) <= 2) {
  143 + array_unshift($host_array, 'm');
  144 + } else {
  145 + $host_array[0] = 'm';
  146 + }
  147 + $amp_domain = implode('.', $host_array);
  148 +
  149 + if ($servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) {
  150 + //过滤已解析到别的ip的AMP域名
  151 + if (!check_domain_record($amp_domain, $servers_ip_info)) {
  152 + Log::channel('analyze_other')->error('AMP域名 [' . $amp_domain . '] 已解析到别的IP');
  153 + continue;
  154 + }
138 } 155 }
139 - }  
140 156
141 - //获取AMP站证书有效期并更新  
142 - $amp_ssl_time = $this->getDomainSslTime($amp_domain);  
143 - if ($amp_ssl_time['from'] && $amp_ssl_time['to']) {  
144 - $v->amp_certificate_start_time = $amp_ssl_time['from'];  
145 - $v->amp_certificate_end_time = $amp_ssl_time['to'];  
146 - $v->save(); 157 + //获取AMP站证书有效期并更新
  158 + $amp_ssl_time = $this->getDomainSslTime($amp_domain);
  159 + if ($amp_ssl_time['from'] && $amp_ssl_time['to']) {
  160 + $v->amp_certificate_start_time = $amp_ssl_time['from'];
  161 + $v->amp_certificate_end_time = $amp_ssl_time['to'];
  162 + $v->save();
  163 + }
147 } 164 }
148 } 165 }
149 } 166 }
@@ -717,7 +717,7 @@ class RelayInquiry extends Command @@ -717,7 +717,7 @@ class RelayInquiry extends Command
717 $project = Project::getProjectByDomain($domain); 717 $project = Project::getProjectByDomain($domain);
718 if (empty($project)) { 718 if (empty($project)) {
719 $this->logChannel()->info('广告任务ID:' . $task['id'] . ', 转发对象:' . $re_website . '非v6链接,转发失败;', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]); 719 $this->logChannel()->info('广告任务ID:' . $task['id'] . ', 转发对象:' . $re_website . '非v6链接,转发失败;', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]);
720 - return [[], $lang]; 720 + return [[], $lang, ''];
721 } 721 }
722 $lang = WebLanguage::getLangById($project->main_lang_id ?? 1)['short']; 722 $lang = WebLanguage::getLangById($project->main_lang_id ?? 1)['short'];
723 723
@@ -23,6 +23,7 @@ use App\Models\Project\ProjectWhiteHatAffix; @@ -23,6 +23,7 @@ use App\Models\Project\ProjectWhiteHatAffix;
23 use App\Models\Template\BTemplateMain; 23 use App\Models\Template\BTemplateMain;
24 use App\Models\Template\TemplateTypeMain; 24 use App\Models\Template\TemplateTypeMain;
25 use App\Models\WebSetting\WebSetting; 25 use App\Models\WebSetting\WebSetting;
  26 +use App\Models\WorkOrder\Tickets;
26 use App\Services\AiBlogService; 27 use App\Services\AiBlogService;
27 use App\Services\CosService; 28 use App\Services\CosService;
28 use App\Services\Geo\GeoService; 29 use App\Services\Geo\GeoService;
@@ -48,13 +49,15 @@ class lyhDemo extends Command @@ -48,13 +49,15 @@ class lyhDemo extends Command
48 protected $description = '更新路由'; 49 protected $description = '更新路由';
49 50
50 public function handle(){ 51 public function handle(){
51 -// $content = "{Introducing the cutting-edge product from Zhejiang Yuexiang Gas Technology Co., Ltd., the Bracket Gas Flowmeter. This innovative gas flowmeter is designed to provide accurate and reliable measurements for a wide range of industrial applications,Equipped with advanced technology and precision components, the Bracket Gas Flowmeter ensures exceptional performance and durability. It offers highly accurate gas flow readings, allowing users to closely monitor and control gas consumption in various processes. The meter's user-friendly interface displays real-time flow rates and totalized flow data, facilitating efficient and convenient data management,With its robust construction and corrosion-resistant materials, the Bracket Gas Flowmeter guarantees long-term reliability, even in harsh operating conditions. It is compatible with various gases such as natural gas, propane, and hydrogen, making it a versatile choice for multiple industries including oil and gas, chemical, and manufacturing,Furthermore, the Bracket Gas Flowmeter is engineered with ease of installation and maintenance in mind. Its compact and space-saving design allows for flexible mounting options, while its modular construction enables quick and hassle-free maintenance. Additionally, it meets international standards for accuracy and safety, ensuring compliance with industry regulations,Choose the Bracket Gas Flowmeter for precise and efficient gas flow measurement, backed by the expertise and commitment of Zhejiang Yuexiang Gas Technology Co., Ltd},{Shop Quality Brackets: Top China Products & Services for Your Needs},4K,高清 --no logo --ar 16:9";  
52 -// $midJourneyService = new MidJourneyService();  
53 -// $result = $midJourneyService->imagine($content);  
54 - $url = 'https://ecdn6-nc.globalso.com/upload/p/1/png/2025-08/688dcebc26a7a59911.png';  
55 - $cosService = new CosService();  
56 - $data = $cosService->cropAndUploadToCOS($url);  
57 - dd($data); 52 + echo 'start.'. PHP_EOL;
  53 + $ticketModel = new Tickets();
  54 + $list = $ticketModel->list(['end_at'=>['!=',null]],'id',['id','created_at','end_at']);
  55 + foreach ($list as $item){
  56 + echo '执行的任务id:'.$item['id'].PHP_EOL;
  57 + $end_time = diffInHours($item['created_at'],$item['end_at']);
  58 + $ticketModel->edit(['end_time'=>$end_time],['id'=>$item['id']]);
  59 + }
  60 + return true;
58 } 61 }
59 62
60 /** 63 /**
@@ -151,13 +151,12 @@ class SyncProject extends Command @@ -151,13 +151,12 @@ class SyncProject extends Command
151 'contract' => json_encode($param['files']), 151 'contract' => json_encode($param['files']),
152 'bill' => json_encode($param['images']), 152 'bill' => json_encode($param['images']),
153 ]; 153 ];
154 - $seoPlan = Project::seoMap();  
155 - if (in_array($param['plan_marketing'], $seoPlan)) {  
156 - $data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;  
157 - $data['deploy_build']['seo_plan'] = $this->versionSeoData($param['plan_marketing'],$seoPlan);  
158 - } else { 154 + $data['deploy_build']['plan'] = $this->versionData($param['plan_marketing'] ?? '');
  155 + $data['deploy_build']['seo_plan'] = $this->versionSeoData($param['geo_plan'] ?? '');
  156 + if(!empty($data['deploy_build']['plan'])){
159 $data['deploy_build']['service_duration'] = $param['years'] ?? 0; 157 $data['deploy_build']['service_duration'] = $param['years'] ?? 0;
160 - $data['deploy_build']['plan'] = $this->versionData($param['plan_marketing']); 158 + }else{
  159 + $data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;
161 } 160 }
162 $renewModel = new ProjectRenew(); 161 $renewModel = new ProjectRenew();
163 $rs = $renewModel->add($data); 162 $rs = $renewModel->add($data);
@@ -184,7 +183,8 @@ class SyncProject extends Command @@ -184,7 +183,8 @@ class SyncProject extends Command
184 } 183 }
185 } 184 }
186 185
187 - public function versionSeoData($param,$data){ 186 + public function versionSeoData($param){
  187 + $data = Project::seoMap();
188 $data = array_flip($data); 188 $data = array_flip($data);
189 if(isset($data[$param])){ 189 if(isset($data[$param])){
190 return $data[$param]; 190 return $data[$param];
@@ -242,13 +242,12 @@ class SyncProject extends Command @@ -242,13 +242,12 @@ class SyncProject extends Command
242 'bill'=>$param['images'] 242 'bill'=>$param['images']
243 ], 243 ],
244 ]; 244 ];
245 - $seoPlan = Project::seoMap();  
246 - if (in_array($param['plan_marketing'], $seoPlan)) {  
247 - $data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;  
248 - $data['deploy_build']['seo_plan'] = $this->versionSeoData($param['plan_marketing'],$seoPlan);  
249 - } else { 245 + $data['deploy_build']['plan'] = $this->versionData($param['plan_marketing'] ?? '');
  246 + $data['deploy_build']['seo_plan'] = $this->versionSeoData($param['geo_plan'] ?? '');
  247 + if(!empty($data['deploy_build']['plan'])){
250 $data['deploy_build']['service_duration'] = $param['years'] ?? 0; 248 $data['deploy_build']['service_duration'] = $param['years'] ?? 0;
251 - $data['deploy_build']['plan'] = $this->versionData($param['plan_marketing']); 249 + }else{
  250 + $data['deploy_build']['seo_service_duration'] = $param['years'] ?? 0;
252 } 251 }
253 DB::beginTransaction(); 252 DB::beginTransaction();
254 try { 253 try {
@@ -46,16 +46,17 @@ class RankDataLog extends BaseCommands @@ -46,16 +46,17 @@ class RankDataLog extends BaseCommands
46 { 46 {
47 while (true) { 47 while (true) {
48 $log_id = Redis::rpop('rank_data_task'); 48 $log_id = Redis::rpop('rank_data_task');
49 - echo $log_id . PHP_EOL; 49 +
50 if (!$log_id) { 50 if (!$log_id) {
51 - sleep(10);  
52 - continue; 51 + $log = RankDataLogModel::where('status', 0)->first();
  52 + }else{
  53 + $log = RankDataLogModel::where('id', $log_id)->where('status', 0)->first();
53 } 54 }
54 -  
55 - $log = RankDataLogModel::where('id', $log_id)->where('status', 0)->first();  
56 if(!$log){ 55 if(!$log){
  56 + sleep(10);
57 continue; 57 continue;
58 } 58 }
  59 +
59 try { 60 try {
60 $this->output('项目开始:ID'.$log->project_id . ',APINO' . $log->api_no); 61 $this->output('项目开始:ID'.$log->project_id . ',APINO' . $log->api_no);
61 $project = Project::find($log->project_id); 62 $project = Project::find($log->project_id);
@@ -5,6 +5,7 @@ namespace App\Console\Commands\Tdk; @@ -5,6 +5,7 @@ namespace App\Console\Commands\Tdk;
5 use App\Exceptions\ValidateException; 5 use App\Exceptions\ValidateException;
6 use App\Helper\Arr; 6 use App\Helper\Arr;
7 use App\Helper\Gpt; 7 use App\Helper\Gpt;
  8 +use App\Helper\Translate;
8 use App\Models\Ai\AiCommand; 9 use App\Models\Ai\AiCommand;
9 use App\Models\Com\NoticeLog; 10 use App\Models\Com\NoticeLog;
10 use App\Models\Com\UpdateNotify; 11 use App\Models\Com\UpdateNotify;
@@ -14,6 +15,7 @@ use App\Models\Project\AggregateKeywordAffix; @@ -14,6 +15,7 @@ use App\Models\Project\AggregateKeywordAffix;
14 use App\Models\Project\DeployBuild; 15 use App\Models\Project\DeployBuild;
15 use App\Models\Project\DeployOptimize; 16 use App\Models\Project\DeployOptimize;
16 use App\Models\Project\ProjectKeywordAiTask; 17 use App\Models\Project\ProjectKeywordAiTask;
  18 +use App\Models\WebSetting\WebLanguage;
17 use App\Services\ProjectServer; 19 use App\Services\ProjectServer;
18 use Illuminate\Console\Command; 20 use Illuminate\Console\Command;
19 use Illuminate\Support\Facades\DB; 21 use Illuminate\Support\Facades\DB;
@@ -51,6 +53,8 @@ class KeywordPageAiContent extends Command @@ -51,6 +53,8 @@ class KeywordPageAiContent extends Command
51 '折线图', 53 '折线图',
52 ]; 54 ];
53 55
  56 + protected $project;
  57 +
54 /** 58 /**
55 * @return bool 59 * @return bool
56 */ 60 */
@@ -66,7 +70,7 @@ class KeywordPageAiContent extends Command @@ -66,7 +70,7 @@ class KeywordPageAiContent extends Command
66 70
67 echo getmypid() . ' ' . date('Y-m-d H:i:s') . ' start project_id: ' . $project_id . PHP_EOL; 71 echo getmypid() . ' ' . date('Y-m-d H:i:s') . ' start project_id: ' . $project_id . PHP_EOL;
68 try { 72 try {
69 - ProjectServer::useProject($project_id); 73 + $this->project = ProjectServer::useProject($project_id);
70 74
71 $update_rows = $this->ai_content($task); 75 $update_rows = $this->ai_content($task);
72 76
@@ -109,6 +113,10 @@ class KeywordPageAiContent extends Command @@ -109,6 +113,10 @@ class KeywordPageAiContent extends Command
109 $prefix = empty($affix['prefix']) ? explode("\n", $default_affix['prefix']) : explode("\n", $affix['prefix']); 113 $prefix = empty($affix['prefix']) ? explode("\n", $default_affix['prefix']) : explode("\n", $affix['prefix']);
110 $suffix = empty($affix['suffix']) ? explode("\n", $default_affix['suffix']) : explode("\n", $affix['suffix']); 114 $suffix = empty($affix['suffix']) ? explode("\n", $default_affix['suffix']) : explode("\n", $affix['suffix']);
111 115
  116 + $lang = WebLanguage::getLangById($this->project['main_lang_id']??1);
  117 + $prefix = Translate::tran($prefix, $lang['short']);
  118 + $suffix = Translate::tran($suffix, $lang['short']);
  119 +
112 if (!$prefix || !$suffix) { 120 if (!$prefix || !$suffix) {
113 throw new ValidateException('扩展标题前后缀不存在'); 121 throw new ValidateException('扩展标题前后缀不存在');
114 } 122 }
@@ -193,8 +201,8 @@ class KeywordPageAiContent extends Command @@ -193,8 +201,8 @@ class KeywordPageAiContent extends Command
193 //打乱顺序 201 //打乱顺序
194 shuffle($prefix); 202 shuffle($prefix);
195 shuffle($suffix); 203 shuffle($suffix);
196 - //标题(title):{聚合页扩展标题前缀} keywords {聚合页扩展标题后缀} {聚合页扩展标题后缀}  
197 204
  205 + //标题(title):{聚合页扩展标题前缀} keywords {聚合页扩展标题后缀} {聚合页扩展标题后缀}
198 return sprintf('%s %s %s %s', $prefix[0], $title, $suffix[0], $suffix[1]); 206 return sprintf('%s %s %s %s', $prefix[0], $title, $suffix[0], $suffix[1]);
199 } 207 }
200 208
@@ -211,6 +219,11 @@ class KeywordPageAiContent extends Command @@ -211,6 +219,11 @@ class KeywordPageAiContent extends Command
211 shuffle($this->chart_types); 219 shuffle($this->chart_types);
212 $prompt = str_replace('{chart_type}', $this->chart_types[0], $prompt); 220 $prompt = str_replace('{chart_type}', $this->chart_types[0], $prompt);
213 } 221 }
  222 + if (strpos($prompt, '{lang}') !== false) {
  223 + $lang = WebLanguage::getLangById($this->project['main_lang_id']??1);
  224 + $lang = $lang['english'] ?? 'English';
  225 + $prompt = str_replace('{lang}', $lang, $prompt);
  226 + }
214 227
215 $text = Gpt::instance()->openai_chat_qqs($prompt); 228 $text = Gpt::instance()->openai_chat_qqs($prompt);
216 if (!$text) { 229 if (!$text) {
@@ -243,7 +256,7 @@ class KeywordPageAiContent extends Command @@ -243,7 +256,7 @@ class KeywordPageAiContent extends Command
243 foreach ($body->childNodes as $child) { 256 foreach ($body->childNodes as $child) {
244 $modifiedHtml .= $dom->saveHTML($child); 257 $modifiedHtml .= $dom->saveHTML($child);
245 } 258 }
246 - return $modifiedHtml; 259 + return html_entity_decode($modifiedHtml, ENT_QUOTES | ENT_HTML5, 'UTF-8');
247 } 260 }
248 261
249 public function sendNotify($project_id) 262 public function sendNotify($project_id)
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TicketCount.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/8/7 17:42
  8 + */
  9 +
  10 +namespace App\Console\Commands\Ticket;
  11 +
  12 +use App\Models\Manage\ManageHr;
  13 +use App\Models\Ticket\TicketDailyManageCount;
  14 +use App\Models\WorkOrder\TicketLog;
  15 +use App\Models\WorkOrder\TicketProject;
  16 +use App\Models\WorkOrder\Tickets;
  17 +use Illuminate\Console\Command;
  18 +
  19 +class TicketCount extends Command
  20 +{
  21 + /**
  22 + * The name and signature of the console command.
  23 + *
  24 + * @var string
  25 + */
  26 + protected $signature = 'ticket_count {action}';
  27 +
  28 + /**
  29 + * The console command description.
  30 + *
  31 + * @var string
  32 + */
  33 + protected $description = '日统计工单';
  34 +
  35 + /**
  36 + * @remark :统计脚本
  37 + * @name :handle
  38 + * @author :lyh
  39 + * @method :post
  40 + * @time :2025/8/7 17:45
  41 + */
  42 + public function handle(){
  43 +
  44 + }
  45 +
  46 + /**
  47 + * @remark :按管理员统计(只统计技术组)
  48 + * @name :manage_action
  49 + * @author :lyh
  50 + * @method :post
  51 + * @time :2025/8/7 17:45
  52 + */
  53 + public function manage_action(){
  54 + $manageHrModel = new ManageHr();
  55 + $manageList = $manageHrModel->list(['status'=>1,'dept_id'=>['in',[1,2]]],'id',['id','manage_id','name','nickname']);
  56 + $date = date('Y-m-d');
  57 + $ticketManageCountModel = new TicketDailyManageCount();
  58 + foreach ($manageList as $item){
  59 + $ticketLogModel = new TicketLog();
  60 + $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
  61 + $data = [
  62 + 'date'=>$date,
  63 + 'manage_id'=>$item['id'],
  64 + 'manage_name'=>$item['name'],
  65 + 'ticket_num'=>$ticket_num,//工单总数量
  66 + 'average_time'=>'',//平均完成工单时长
  67 + 'fastest_time'=>'',//最快完成工单时间
  68 + 'timeout_num'=>'',//超时工单数量
  69 + 'complete_num'=>'',//完成工单数量
  70 + ];
  71 + //查询当前用户是否当日已有记录
  72 + $ticketManageInfo = $ticketManageCountModel->read(['date'=>$date,'manage_id'=>$item['id']],['id']);
  73 + if($ticketManageInfo === false){
  74 + //TODO::执行新增
  75 +
  76 + }else{
  77 + //TODO::执行编辑
  78 + }
  79 + }
  80 + }
  81 +}
@@ -1421,3 +1421,22 @@ function getTopDomain ($url) { @@ -1421,3 +1421,22 @@ function getTopDomain ($url) {
1421 return $host; 1421 return $host;
1422 } 1422 }
1423 1423
  1424 +/**
  1425 + * @remark :两个时间的差值
  1426 + * @name :diffInHours
  1427 + * @author :lyh
  1428 + * @method :post
  1429 + * @time :2025/8/8 9:10
  1430 + */
  1431 +function diffInHours($startTime, $endTime)
  1432 +{
  1433 + $start = new DateTime($startTime);
  1434 + $end = new DateTime($endTime);
  1435 + // 计算时间差
  1436 + $interval = $start->diff($end);
  1437 + // 总小时数 = 天数 * 24 + 小时数 + 分钟数换算成小数小时
  1438 + $hours = $interval->days * 24 + $interval->h + ($interval->i / 60);
  1439 + // 四舍五入保留1位小数
  1440 + return round($hours, 1);
  1441 +}
  1442 +
@@ -255,7 +255,11 @@ class OptimizeController extends BaseController @@ -255,7 +255,11 @@ class OptimizeController extends BaseController
255 $query = $query->where('gl_project.site_status',$this->map['site_status']); 255 $query = $query->where('gl_project.site_status',$this->map['site_status']);
256 } 256 }
257 if(isset($this->map['seo_plan'])){ 257 if(isset($this->map['seo_plan'])){
258 - $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); 258 + if(is_array($this->map['seo_plan'])){
  259 + $query = $query->whereIn('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
  260 + }else{
  261 + $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
  262 + }
259 } 263 }
260 if(isset($this->map['main_lang_id'])){ 264 if(isset($this->map['main_lang_id'])){
261 $query = $query->where('gl_project.main_lang_id',$this->map['main_lang_id']); 265 $query = $query->where('gl_project.main_lang_id',$this->map['main_lang_id']);
@@ -23,6 +23,7 @@ use App\Models\Devops\ServersIp; @@ -23,6 +23,7 @@ use App\Models\Devops\ServersIp;
23 use App\Models\Domain\DomainCreateTask; 23 use App\Models\Domain\DomainCreateTask;
24 use App\Models\Domain\DomainInfo; 24 use App\Models\Domain\DomainInfo;
25 use App\Models\Domain\DomainInfo as DomainInfoModel; 25 use App\Models\Domain\DomainInfo as DomainInfoModel;
  26 +use App\Models\Geo\GeoLink;
26 use App\Models\HomeCount\Count; 27 use App\Models\HomeCount\Count;
27 use App\Models\Industry\ProjectIndustry; 28 use App\Models\Industry\ProjectIndustry;
28 use App\Models\Inquiry\InquirySet; 29 use App\Models\Inquiry\InquirySet;
@@ -314,7 +315,7 @@ class ProjectController extends BaseController @@ -314,7 +315,7 @@ class ProjectController extends BaseController
314 } 315 }
315 } 316 }
316 if(isset($this->map['seo_plan'])){ 317 if(isset($this->map['seo_plan'])){
317 - $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); 318 + $query = $query->where('gl_project_deploy_build.seo_plan','!=',0);
318 } 319 }
319 if(isset($this->map['site_status'])){ 320 if(isset($this->map['site_status'])){
320 $query = $query->where('gl_project.site_status',$this->map['site_status']); 321 $query = $query->where('gl_project.site_status',$this->map['site_status']);
@@ -329,6 +330,15 @@ class ProjectController extends BaseController @@ -329,6 +330,15 @@ class ProjectController extends BaseController
329 if(isset($this->map['project_type'])){ 330 if(isset($this->map['project_type'])){
330 $query = $query->where('gl_project.project_type',$this->map['project_type']); 331 $query = $query->where('gl_project.project_type',$this->map['project_type']);
331 } 332 }
  333 + if(isset($this->param['geo'])){
  334 + if($this->param['geo'] == 1){
  335 + $query = $query->where('gl_project.geo_status',1);
  336 + }else{
  337 + $ids = GeoLink::pluck('project_id')->unique()->values()->all();
  338 + $query = $query->whereIn('gl_project.id',$ids);
  339 + }
  340 +
  341 + }
332 return $query; 342 return $query;
333 } 343 }
334 344
@@ -1297,7 +1307,8 @@ class ProjectController extends BaseController @@ -1297,7 +1307,8 @@ class ProjectController extends BaseController
1297 */ 1307 */
1298 public function videoSetting(){ 1308 public function videoSetting(){
1299 $videoModel = new AiVideoTask(); 1309 $videoModel = new AiVideoTask();
1300 - $data = $videoModel->videoSetting(); 1310 + $data['videoSetting'] = $videoModel->videoSetting();
  1311 + $data['videoFrequency'] =$videoModel->videoFrequency();
1301 $this->response('success',Code::SUCCESS,$data); 1312 $this->response('success',Code::SUCCESS,$data);
1302 } 1313 }
1303 } 1314 }
@@ -239,8 +239,9 @@ class AsideTicketController extends BaseController @@ -239,8 +239,9 @@ class AsideTicketController extends BaseController
239 { 239 {
240 // 完成工单,把子任务里面未完成的工单改为完成 240 // 完成工单,把子任务里面未完成的工单改为完成
241 $ticket->end_at = now(); 241 $ticket->end_at = now();
  242 + $ticket->end_time = diffInHours($ticket->created_at,now());
242 $ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED)->where('is_engineer', 1) 243 $ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED)->where('is_engineer', 1)
243 - ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]); 244 + ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now(),'end_time'=>$ticket->end_time]);
244 // 推动微信通知 245 // 推动微信通知
245 $project = $ticket->project; 246 $project = $ticket->project;
246 if ($project->wechat_switch && !$ticket->close_wechat) 247 if ($project->wechat_switch && !$ticket->close_wechat)
@@ -70,6 +70,7 @@ class AsideTicketLogController extends BaseController @@ -70,6 +70,7 @@ class AsideTicketLogController extends BaseController
70 { 70 {
71 // 我的工单标记为已完成 71 // 我的工单标记为已完成
72 $log->end_at = now(); 72 $log->end_at = now();
  73 + $log->end_time = diffInHours($ticket->created_at,now());
73 } 74 }
74 } 75 }
75 if ($request->input('reply') !== null) 76 if ($request->input('reply') !== null)
@@ -91,6 +92,7 @@ class AsideTicketLogController extends BaseController @@ -91,6 +92,7 @@ class AsideTicketLogController extends BaseController
91 { 92 {
92 $ticket->status = Tickets::STATUS_COMPLETED; 93 $ticket->status = Tickets::STATUS_COMPLETED;
93 $ticket->end_at = now(); 94 $ticket->end_at = now();
  95 + $ticket->end_time = diffInHours($ticket->created_at,$ticket->end_at);
94 $project = $ticket->project; 96 $project = $ticket->project;
95 if ($project->wechat_switch && !$ticket->close_wechat) 97 if ($project->wechat_switch && !$ticket->close_wechat)
96 $project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!"); 98 $project->pushWechatGroupMsg("工单(ID:{$ticket->id})已全部完成,请访问查看详情!");
@@ -83,7 +83,7 @@ class LoginLogic extends BaseLogic @@ -83,7 +83,7 @@ class LoginLogic extends BaseLogic
83 $manage['special'] = $this->getSpecialMenu($manage['id']); 83 $manage['special'] = $this->getSpecialMenu($manage['id']);
84 //岗位 84 //岗位
85 $manage['entry_position'] = ManageHr::where('manage_id', $manage['id'])->value('entry_position')?:0; 85 $manage['entry_position'] = ManageHr::where('manage_id', $manage['id'])->value('entry_position')?:0;
86 - Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 6); 86 + Cache::add(Common::MANAGE_TOKEN . $token,$manage,3600 * 12);
87 return $this->success($manage->makeVisible('token')->toArray()); 87 return $this->success($manage->makeVisible('token')->toArray());
88 } 88 }
89 89
@@ -22,7 +22,7 @@ class AiVideoTask extends Base @@ -22,7 +22,7 @@ class AiVideoTask extends Base
22 const STATUS_FINISH = 2; 22 const STATUS_FINISH = 2;
23 23
24 /** 24 /**
25 - * @remark :视频设 25 + * @remark :
26 * @name :videoSetting 26 * @name :videoSetting
27 * @author :lyh 27 * @author :lyh
28 * @method :post 28 * @method :post
@@ -34,4 +34,20 @@ class AiVideoTask extends Base @@ -34,4 +34,20 @@ class AiVideoTask extends Base
34 2 => 'YOUTUBE' 34 2 => 'YOUTUBE'
35 ]; 35 ];
36 } 36 }
  37 +
  38 + /**
  39 + * @remark :配置
  40 + * @name :videoFrequency
  41 + * @author :lyh
  42 + * @method :post
  43 + * @time :2025/8/1 17:17
  44 + */
  45 + public function videoFrequency(){
  46 + return [
  47 + 1 => '3-4',
  48 + 2 => '5-7',
  49 + 3 => '7-10',
  50 + 2 => '10-15',
  51 + ];
  52 + }
37 } 53 }
@@ -139,7 +139,9 @@ class Project extends Base @@ -139,7 +139,9 @@ class Project extends Base
139 { 139 {
140 return [ 140 return [
141 1 => 'GEO标准版', 141 1 => 'GEO标准版',
142 - 2 => 'GEO商务版' 142 + 2 => 'GEO商务版',
  143 + 3 => '白帽SEO版',
  144 + 9 => 'GEO体验版'
143 ]; 145 ];
144 } 146 }
145 /** 147 /**
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TicketDailyCount.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/8/7 17:50
  8 + */
  9 +
  10 +namespace App\Models\Ticket;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :工单日统计
  16 + * @name :TicketDailyCount
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/8/7 17:51
  20 + */
  21 +class TicketDailyCount extends Base
  22 +{
  23 + protected $table = 'gl_ticket_daily_count';
  24 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TicketDailyDeptCount.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/8/7 17:51
  8 + */
  9 +
  10 +namespace App\Models\Ticket;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :工单日统计:按照技术组统计
  16 + * @name :TicketDailyDeptCount
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/8/7 17:51
  20 + */
  21 +class TicketDailyDeptCount extends Base
  22 +{
  23 + protected $table = 'gl_ticket_daily_dept_count';
  24 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TicketDailyManageCount.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/8/7 17:52
  8 + */
  9 +
  10 +namespace App\Models\Ticket;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :工单日统计:按照人员统计
  16 + * @name :TicketDailyManageCount
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/8/7 17:53
  20 + */
  21 +class TicketDailyManageCount extends Base
  22 +{
  23 + protected $table = 'gl_ticket_daily_manage_count';
  24 +}