作者 刘锟

update

正在显示 37 个修改的文件 包含 711 行增加113 行删除
@@ -77,14 +77,16 @@ class AiBlogAutoPublish extends Command @@ -77,14 +77,16 @@ class AiBlogAutoPublish extends Command
77 $this->output("项目{$project->id}未到执行时间" . $next_auto_date); 77 $this->output("项目{$project->id}未到执行时间" . $next_auto_date);
78 continue; 78 continue;
79 } 79 }
80 - //核心关键词+网站关键词 80 + //核心关键词+网站关键词+白帽关键词
81 $main_keywords = ProjectKeyword::where('project_id', $project->id)->value('main_keyword'); 81 $main_keywords = ProjectKeyword::where('project_id', $project->id)->value('main_keyword');
82 $main_keywords = explode("\r\n", $main_keywords); 82 $main_keywords = explode("\r\n", $main_keywords);
  83 + $seo_keywords = ProjectKeyword::where('project_id', $project->id)->value('seo_keywords');
  84 + $seo_keywords = explode("\r\n", $seo_keywords);
83 ProjectServer::useProject($project->id); 85 ProjectServer::useProject($project->id);
84 $site_keywords = WebSetting::where('project_id', $project->id)->value('keyword'); 86 $site_keywords = WebSetting::where('project_id', $project->id)->value('keyword');
85 DB::disconnect('custom_mysql'); 87 DB::disconnect('custom_mysql');
86 $site_keywords = explode(",", $site_keywords); 88 $site_keywords = explode(",", $site_keywords);
87 - $keywords = array_filter(array_merge($main_keywords, $site_keywords)); 89 + $keywords = array_filter(array_merge($main_keywords, $site_keywords, $seo_keywords));
88 $keywords = array_map('trim', $keywords); 90 $keywords = array_map('trim', $keywords);
89 if (empty($keywords)) { 91 if (empty($keywords)) {
90 $this->output("项目{$project->id}未获取到关键词"); 92 $this->output("项目{$project->id}未获取到关键词");
@@ -87,6 +87,9 @@ class CountProject extends Command @@ -87,6 +87,9 @@ class CountProject extends Command
87 //剩余服务时常 87 //剩余服务时常
88 $arr['service_day'] = $projectInfo['remain_day']; 88 $arr['service_day'] = $projectInfo['remain_day'];
89 $arr = $this->inquiry($arr,$domain, $project_id,$projectInfo['is_upgrade'] ?? 0); 89 $arr = $this->inquiry($arr,$domain, $project_id,$projectInfo['is_upgrade'] ?? 0);
  90 + if($arr === false){
  91 + continue;
  92 + }
90 //查询当天数据是否存在 存在则更新 93 //查询当天数据是否存在 存在则更新
91 $info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]); 94 $info = $count->read(['date'=>$v['updated_date'],'project_id'=>$project_id]);
92 if($info === false){ 95 if($info === false){
@@ -146,7 +149,7 @@ class CountProject extends Command @@ -146,7 +149,7 @@ class CountProject extends Command
146 public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){ 149 public function inquiry($arr,$domain,$project_id,$is_upgrade = 0){
147 $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade); 150 $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$is_upgrade);
148 if($inquiry_list == false){ 151 if($inquiry_list == false){
149 - return false; 152 + return $arr;
150 } 153 }
151 // echo date('Y-m-d H:i:s') . '拉取询盘状态:' .json_encode($inquiry_list) . PHP_EOL; 154 // echo date('Y-m-d H:i:s') . '拉取询盘状态:' .json_encode($inquiry_list) . PHP_EOL;
152 if($inquiry_list['status'] == self::STATUS_ERROR){ 155 if($inquiry_list['status'] == self::STATUS_ERROR){
@@ -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 38 + 4247,4299,4310,4215,4038,4084,4148,4178
39 ]; 39 ];
40 40
41 41
@@ -83,7 +83,7 @@ class RemainDay extends Command @@ -83,7 +83,7 @@ class RemainDay extends Command
83 * @time :2025/4/2 10:48 83 * @time :2025/4/2 10:48
84 */ 84 */
85 public function saveRemainDay(){ 85 public function saveRemainDay(){
86 - $list = $this->project->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','uptime','remain_day','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']); 86 + $list = $this->project->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','level','uptime','remain_day','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']);
87 foreach ($list as $item){ 87 foreach ($list as $item){
88 $deploy_build = $this->deployBuild->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']); 88 $deploy_build = $this->deployBuild->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']);
89 echo 'start->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL; 89 echo 'start->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL;
@@ -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)){ 123 + if(in_array($item['id'],$this->bm_projectId) || (strpos($item['level'], '19') !== false)){
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{
@@ -113,12 +113,32 @@ class GeoQuestionRes extends Command @@ -113,12 +113,32 @@ class GeoQuestionRes extends Command
113 } 113 }
114 // 命中文案 114 // 命中文案
115 $hit_data[] = $result['text']; 115 $hit_data[] = $result['text'];
  116 +
116 if(!empty($result['annotations'])){ 117 if(!empty($result['annotations'])){
117 $url = array_column(array_column($result['annotations'], 'url_citation'), 'url'); 118 $url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
118 $title = array_column(array_column($result['annotations'], 'url_citation'), 'title'); 119 $title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
119 $hit_data = array_merge($url, $title, $hit_data); 120 $hit_data = array_merge($url, $title, $hit_data);
120 } 121 }
121 $hit = 0; 122 $hit = 0;
  123 + //todo::与预期结果是否复合
  124 + if(!empty($taskInfo['expect_result'])){
  125 + $str = "客户提出的问题:{$question},客户得到的回复:{$result['text']},客户需要预期:{$taskInfo['expect_result']},请分析得到的回复和预期是否一致,仅回复我是或者否";
  126 + $strResult = $geo_service->getChatResult($str, 'gpt-4o-mini');
  127 + if(isset($strResult['text']) && !empty($strResult['text'])){
  128 + switch ($strResult['text']){
  129 + case '是':
  130 + $is_match = 1;
  131 + $hit++;
  132 + break;
  133 + case '否':
  134 + $is_match = 2;
  135 + break;
  136 + default:
  137 + $is_match = 0;
  138 + break;
  139 + }
  140 + }
  141 + }
122 $hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data); 142 $hit_keyword = $this->getKeywords($taskInfo['keywords'],$hit_data);
123 if (!empty($hit_keyword['keywords'])) { 143 if (!empty($hit_keyword['keywords'])) {
124 $hit++; 144 $hit++;
@@ -144,6 +164,7 @@ class GeoQuestionRes extends Command @@ -144,6 +164,7 @@ class GeoQuestionRes extends Command
144 'hit' => $hit ?? 0, 164 'hit' => $hit ?? 0,
145 'keywords_num'=>$keyword_num ?? [], 165 'keywords_num'=>$keyword_num ?? [],
146 'url_num'=>$url_num ?? [], 166 'url_num'=>$url_num ?? [],
  167 + 'is_match'=>$is_match ?? 0,
147 'created_at'=>date('Y-m-d H:i:s'), 168 'created_at'=>date('Y-m-d H:i:s'),
148 'updated_at'=>date('Y-m-d H:i:s'), 169 'updated_at'=>date('Y-m-d H:i:s'),
149 ]; 170 ];
@@ -294,6 +315,17 @@ class GeoQuestionRes extends Command @@ -294,6 +315,17 @@ class GeoQuestionRes extends Command
294 } 315 }
295 316
296 /** 317 /**
  318 + * @remark :预期结果对比
  319 + * @name :getExpectResult
  320 + * @author :lyh
  321 + * @method :post
  322 + * @time :2025/8/12 13:51
  323 + */
  324 + public function getExpectResult($question,$answer,$expect){
  325 + $str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否";
  326 + }
  327 +
  328 + /**
297 * 获取待执行任务ID 329 * 获取待执行任务ID
298 * @return mixed 330 * @return mixed
299 */ 331 */
@@ -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,8 @@ use App\Models\Project\ProjectWhiteHatAffix; @@ -23,6 +23,8 @@ 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\TicketLog;
  27 +use App\Models\WorkOrder\Tickets;
26 use App\Services\AiBlogService; 28 use App\Services\AiBlogService;
27 use App\Services\CosService; 29 use App\Services\CosService;
28 use App\Services\Geo\GeoService; 30 use App\Services\Geo\GeoService;
@@ -48,13 +50,20 @@ class lyhDemo extends Command @@ -48,13 +50,20 @@ class lyhDemo extends Command
48 protected $description = '更新路由'; 50 protected $description = '更新路由';
49 51
50 public function handle(){ 52 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); 53 + return $this->getExpectResult();
  54 + return true;
  55 + }
  56 +
  57 + public function getExpectResult(){
  58 + $geo_service = new GeoService();
  59 + $question = 'Top AI Coffee Robot';
  60 + $answer = "Top AI Coffee Robot\" refers to advanced robotic systems that combine **precision automation, artificial intelligence, and specialty coffee expertise** to create high-quality beverages with minimal human intervention. Here's a breakdown of key features, leading examples, and benefits:\n\n### Core Features of Top AI Coffee Robots:\n1. **AI-Driven Customization** \n - Analyzes user preferences (strength, milk type, sweetness) via app profiles or voice commands. \n - Learns from feedback to refine future orders (e.g., \"less bitter than last time\"). \n2. **Robotic Precision Brewing** \n - Industrial arms handle grinding, tamping, steaming milk, and latte art with sub-millimeter accuracy. \n - Sensors monitor temperature, extraction time, and pressure for optimal flavor.";
  61 + $expect = "While I don't have specific information on the RobotAnno coffee machine, in general";
  62 + $str = "客户提出的问题:{$question},客户得到的回复:{$answer},客户需要预期:{$expect},请分析得到的回复和预期是否一致,仅回复我是或者否";
  63 + $data = $geo_service->getChatResult($str, 'gpt-4o-mini');
  64 + if(isset($data['text']) && $data['text'] == '是'){
  65 +
  66 + }
58 } 67 }
59 68
60 /** 69 /**
@@ -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,16 @@ class RankDataLog extends BaseCommands @@ -46,16 +46,16 @@ 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;  
50 if (!$log_id) { 49 if (!$log_id) {
51 - sleep(10);  
52 - continue; 50 + $log_id = RankDataLogModel::where('status', 0)->value('id');
53 } 51 }
54 -  
55 $log = RankDataLogModel::where('id', $log_id)->where('status', 0)->first(); 52 $log = RankDataLogModel::where('id', $log_id)->where('status', 0)->first();
  53 +
56 if(!$log){ 54 if(!$log){
  55 + sleep(10);
57 continue; 56 continue;
58 } 57 }
  58 +
59 try { 59 try {
60 $this->output('项目开始:ID'.$log->project_id . ',APINO' . $log->api_no); 60 $this->output('项目开始:ID'.$log->project_id . ',APINO' . $log->api_no);
61 $project = Project::find($log->project_id); 61 $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)
@@ -59,14 +59,15 @@ class RerunSeoTdk extends Command @@ -59,14 +59,15 @@ class RerunSeoTdk extends Command
59 */ 59 */
60 public function handle() 60 public function handle()
61 { 61 {
62 - $where = [  
63 - 'id' => 624  
64 - ];  
65 - $project_ids = Project::where('type', Project::TYPE_TWO)->where($where)->pluck('id')->toArray(); 62 + $project_ids = Project::where('type', Project::TYPE_TWO)->where('site_status',0)->where('extend_type',0)->where('delete_status',0)->where('tag_page_version', '>' ,1)->where('uptime', '<=', date('Y-m-d H:i:s'))->pluck('id')->toArray();
66 foreach ($project_ids as $project_id){ 63 foreach ($project_ids as $project_id){
67 try { 64 try {
68 - ProjectServer::useProject($project_id);  
69 - $this->changeCompanyName($project_id); 65 + $project = ProjectServer::useProject($project_id);
  66 +
  67 + //小语种
  68 + if($project['main_lang_id'] != 1){
  69 + $this->needTransKeywordPage($project_id);
  70 + }
70 DB::disconnect('custom_mysql'); 71 DB::disconnect('custom_mysql');
71 }catch (\Exception $e){ 72 }catch (\Exception $e){
72 dump($e->getMessage()); 73 dump($e->getMessage());
@@ -74,6 +75,13 @@ class RerunSeoTdk extends Command @@ -74,6 +75,13 @@ class RerunSeoTdk extends Command
74 } 75 }
75 } 76 }
76 77
  78 + public function needTransKeywordPage($project_id)
  79 + {
  80 + $row = Keyword::whereNotNull('sale_title')->update(['sale_title' => null, 'sale_content' => null, 'count_title'=>null, 'table_html'=>null, 'count_html' => null]);
  81 + dump($project_id .' - ' .$row);
  82 + }
  83 +
  84 +
77 /** 85 /**
78 * 换了公司英文名的 86 * 换了公司英文名的
79 * @author zbj 87 * @author zbj
  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\BelongingGroup;
  13 +use App\Models\Manage\ManageHr;
  14 +use App\Models\Ticket\TicketDailyCount;
  15 +use App\Models\Ticket\TicketDailyDeptCount;
  16 +use App\Models\Ticket\TicketDailyManageCount;
  17 +use App\Models\WorkOrder\TicketLog;
  18 +use App\Models\WorkOrder\TicketProject;
  19 +use App\Models\WorkOrder\Tickets;
  20 +use Illuminate\Console\Command;
  21 +use Illuminate\Support\Carbon;
  22 +use Illuminate\Support\Facades\DB;
  23 +use Illuminate\Support\Facades\Log;
  24 +
  25 +class TicketCount extends Command
  26 +{
  27 + /**
  28 + * The name and signature of the console command.
  29 + *
  30 + * @var string
  31 + */
  32 + protected $signature = 'ticket_count {action}';
  33 +
  34 + /**
  35 + * The console command description.
  36 + *
  37 + * @var string
  38 + */
  39 + protected $description = '日统计工单';
  40 +
  41 + public $belong = [
  42 + 1 => [1,2,3,4,5,6,7,8,9],
  43 + 2 => [10,11,12],
  44 + ];
  45 +
  46 + /**
  47 + * @remark :统计脚本
  48 + * @name :handle
  49 + * @author :lyh
  50 + * @method :post
  51 + * @time :2025/8/7 17:45
  52 + */
  53 + public function handle(){
  54 + $action = $this->argument('action');
  55 + if($action == 'manage_action'){
  56 + $this->manage_action();
  57 + }
  58 + if($action == 'dept_action'){
  59 + $this->dept_action();
  60 + }
  61 + if($action == 'yesterday_daily_action'){
  62 + $this->yesterday_daily_action();
  63 + }
  64 + }
  65 +
  66 + /**
  67 + * @remark :按管理员统计(只统计技术组)
  68 + * @name :manage_action
  69 + * @author :lyh
  70 + * @method :post
  71 + * @time :2025/8/7 17:45
  72 + */
  73 + public function manage_action(){
  74 + $manageHrModel = new ManageHr();
  75 + $manageList = $manageHrModel->list(['status'=>1,'dept_id'=>['in',[1,2]]],'id',['id','dept_id','manage_id','name','nickname']);
  76 + $date = Carbon::yesterday()->toDateString(); // 昨日时间
  77 + $ticketManageCountModel = new TicketDailyManageCount();
  78 + foreach ($manageList as $item){
  79 + $average_time = '';
  80 + $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']);
  81 + $ticketLogModel = new TicketLog();
  82 + $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
  83 + //工单总时长
  84 + $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 + if(!empty($timeCount)){
  87 + $average_time = round($timeCount / $ticket_end_num, 2);
  88 + }
  89 + //最快完成的时间
  90 + $fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time');
  91 + //超时工单数量
  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]);
  94 + $data = [
  95 + 'date'=>$date,
  96 + 'manage_id'=>$item['id'],
  97 + 'manage_name'=>$item['name'],
  98 + 'ticket_num'=>$ticket_num,//工单总数量
  99 + 'average_time'=>$average_time ?? '',//平均完成工单时长
  100 + 'fastest_time'=>$fastest_time,//最快完成工单时间
  101 + 'timeout_num'=>$timeout_num,//超时工单数量
  102 + 'complete_num'=>$complete_num,//完成工单数量
  103 + 'dept_id'=>$item['dept_id']
  104 + ];
  105 + //查询当前用户是否当日已有记录
  106 + $ticketManageInfo = $ticketManageCountModel->read(['date'=>$date,'manage_id'=>$item['id']],['id']);
  107 + if($ticketManageInfo === false){
  108 + //TODO::执行新增
  109 + $ticketManageCountModel->addReturnId($data);
  110 + }else{
  111 + //TODO::执行编辑
  112 + $ticketManageCountModel->edit($data,['id'=>$ticketManageInfo['id']]);
  113 + }
  114 + }
  115 + return true;
  116 + }
  117 +
  118 + /**
  119 + * @remark :按技术组统计数据
  120 + * @name :dept_action
  121 + * @author :lyh
  122 + * @method :post
  123 + * @time :2025/8/8 11:48
  124 + */
  125 + public function dept_action(){
  126 + $belongingGroupModel = new BelongingGroup();
  127 + $groupList = $belongingGroupModel->list(['id'=>['in',[1,2,3,4,5,6,7,8,9]]],'id',['id','name']);
  128 + $manageHrModel = new ManageHr();
  129 + $ticketLogModel = new TicketLog();
  130 + $ticketDailyDeptModel = new TicketDailyDeptCount();
  131 + $date = Carbon::yesterday()->toDateString(); // "2025-08-07"
  132 + foreach ($groupList as $item){
  133 + $average_time = '';
  134 + $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']);
  135 + $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]);
  137 + $timeCount = $ticketLogModel->formatQuery(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1])->sum('end_time');
  138 + if(!empty($timeCount)){
  139 + $average_time = round($timeCount / $ticket_num, 2);
  140 + }
  141 + $data = [
  142 + 'date'=>$date,
  143 + 'dept_id'=>$item['id'],
  144 + 'dept_name'=>$item['name'],
  145 + 'ticket_num'=>$ticket_num ?? 0,
  146 + 'average_time'=>$average_time ?? ''
  147 + ];
  148 + $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']);
  149 + if($deptInfo === false){
  150 + $ticketDailyDeptModel->addReturnId($data);
  151 + }else{
  152 + $ticketDailyDeptModel->edit($data,['id'=>$deptInfo['id']]);
  153 + }
  154 + }
  155 + return true;
  156 + }
  157 +
  158 + /**
  159 + * @remark :技术组所有工单记录
  160 + * @name :daily_action
  161 + * @author :lyh
  162 + * @method :post
  163 + * @time :2025/8/8 14:33
  164 + */
  165 + public function yesterday_daily_action(){
  166 + $ticketModel = new Tickets();
  167 + $date = Carbon::yesterday()->toDateString(); // "2025-08-07"
  168 + $ticket_num = $ticketModel->counts(['id'=>['!=',0]]);
  169 + $time_end_num = $ticketModel->counts(['end_at'=>['!=',null]]);//已完成的工单
  170 + $time_end_count = $ticketModel->formatQuery(['end_at'=>['!=',null]])->sum('end_time');//已完成工单时长
  171 + if(!empty($time_end_count)){
  172 + $average_time = round($time_end_count / $time_end_num, 2);
  173 + }
  174 + $add_num = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);
  175 + $untreated_num = $ticketModel->counts(['end_at'=>null]);
  176 + $processed_num = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);
  177 + $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side');
  178 + $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side');
  179 + $dbResult = DB::table('gl_ticket_projects as p')->leftJoin('gl_tickets as t', 'p.id', '=', 't.project_id')
  180 + ->select(
  181 + 'p.project_cate',
  182 + DB::raw('COUNT(t.id) as ticket_count')
  183 + )
  184 + ->groupBy('p.project_cate')
  185 + ->pluck('ticket_count', 'project_cate');
  186 + $data = [
  187 + 'date' => $date,
  188 + 'ticket_num'=>$ticket_num,
  189 + 'add_num'=>$add_num,
  190 + 'untreated_num'=>$untreated_num,
  191 + 'processed_num'=>$processed_num,
  192 + 'average_time'=>$average_time ?? '',
  193 + 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true),
  194 + 'source_type'=>json_encode($dbResult,true)
  195 + ];
  196 + $ticketDailyModel = new TicketDailyCount();
  197 + $ticketDailyInfo = $ticketDailyModel->read(['date'=>$date],['id']);
  198 + if($ticketDailyInfo === false){
  199 + $ticketDailyModel->addReturnId($data);
  200 + }else{
  201 + $ticketDailyModel->edit($data,['id'=>$ticketDailyInfo['id']]);
  202 + }
  203 + return true;
  204 + }
  205 +
  206 + /**
  207 + * @remark :日志
  208 + * @name :output
  209 + * @author :lyh
  210 + * @method :post
  211 + * @time :2025/8/8 11:43
  212 + */
  213 + public function output($message)
  214 + {
  215 +// Log::channel('ticket_log')->info($message);
  216 + echo date('Y-m-d H:i:s') . ' ' . $message . PHP_EOL;
  217 + }
  218 +}
@@ -18,7 +18,7 @@ class FetchTicketProjects extends Command @@ -18,7 +18,7 @@ class FetchTicketProjects extends Command
18 * 18 *
19 * @var string 19 * @var string
20 */ 20 */
21 - protected $signature = 'workorder:fetch-ticket-projects {action}'; 21 + protected $signature = 'workorder:fetch-Ticket-projects {action}';
22 22
23 /** 23 /**
24 * The console command description. 24 * The console command description.
@@ -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 +
@@ -37,7 +37,7 @@ class BaseController extends Controller @@ -37,7 +37,7 @@ class BaseController extends Controller
37 $info = Cache::get(Common::MANAGE_TOKEN . $this->token); 37 $info = Cache::get(Common::MANAGE_TOKEN . $this->token);
38 if(!empty($this->token) && !empty($info)){ 38 if(!empty($this->token) && !empty($info)){
39 $this->manage = $info; 39 $this->manage = $info;
40 - Cache::put(Common::MANAGE_TOKEN . $this->token, $info, 3600 * 6);//更新缓存时间 40 + Cache::put(Common::MANAGE_TOKEN . $this->token, $info, 3600 * 12);//更新缓存时间
41 $this->uid = $info['id']; 41 $this->uid = $info['id'];
42 } 42 }
43 } 43 }
@@ -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;
@@ -142,7 +143,11 @@ class ProjectController extends BaseController @@ -142,7 +143,11 @@ class ProjectController extends BaseController
142 * @time :2023/12/29 17:14 143 * @time :2023/12/29 17:14
143 */ 144 */
144 public function orderByList($query){ 145 public function orderByList($query){
145 - $query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc'); 146 + if(isset($this->map['seo_plan']) && $this->map['seo_plan'] == 1){
  147 + $query = $query->orderBy('gl_project.cooperate_date', 'desc')->orderBy('gl_project.id', 'desc');
  148 + }else{
  149 + $query = $query->orderBy('gl_project.uptime', 'desc')->orderBy('gl_project.id', 'desc');
  150 + }
146 return $query; 151 return $query;
147 } 152 }
148 153
@@ -314,7 +319,7 @@ class ProjectController extends BaseController @@ -314,7 +319,7 @@ class ProjectController extends BaseController
314 } 319 }
315 } 320 }
316 if(isset($this->map['seo_plan'])){ 321 if(isset($this->map['seo_plan'])){
317 - $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); 322 + $query = $query->where('gl_project_deploy_build.seo_plan','!=',0);
318 } 323 }
319 if(isset($this->map['site_status'])){ 324 if(isset($this->map['site_status'])){
320 $query = $query->where('gl_project.site_status',$this->map['site_status']); 325 $query = $query->where('gl_project.site_status',$this->map['site_status']);
@@ -329,6 +334,15 @@ class ProjectController extends BaseController @@ -329,6 +334,15 @@ class ProjectController extends BaseController
329 if(isset($this->map['project_type'])){ 334 if(isset($this->map['project_type'])){
330 $query = $query->where('gl_project.project_type',$this->map['project_type']); 335 $query = $query->where('gl_project.project_type',$this->map['project_type']);
331 } 336 }
  337 + if(isset($this->param['geo'])){
  338 + if($this->param['geo'] == 1){
  339 + $query = $query->where('gl_project.geo_status',1);
  340 + }else{
  341 + $ids = GeoLink::pluck('project_id')->unique()->values()->all();
  342 + $query = $query->whereIn('gl_project.id',$ids);
  343 + }
  344 +
  345 + }
332 return $query; 346 return $query;
333 } 347 }
334 348
@@ -765,13 +779,15 @@ class ProjectController extends BaseController @@ -765,13 +779,15 @@ class ProjectController extends BaseController
765 * @author zbj 779 * @author zbj
766 * @date 2023/9/11 780 * @date 2023/9/11
767 */ 781 */
768 - public function getProjectByChannel(){ 782 + public function getProjectByChannel(Request $request){
769 $id = $this->param['id'] ?? ''; 783 $id = $this->param['id'] ?? '';
770 $notice_order_id = $this->param['notice_order_id'] ?? ''; 784 $notice_order_id = $this->param['notice_order_id'] ?? '';
771 $source_id = $this->param['channel_id'] ?? 0; //原系统渠道id 785 $source_id = $this->param['channel_id'] ?? 0; //原系统渠道id
772 $size = $this->param['page_size'] ?? 20; 786 $size = $this->param['page_size'] ?? 20;
773 $type = $this->param['type'] ?? ''; 787 $type = $this->param['type'] ?? '';
774 $company = $this->param['company'] ?? ''; 788 $company = $this->param['company'] ?? '';
  789 + $order_by_field = $request->input('order_by_field', 'id');
  790 + $order_by_sort = $request->input('order_by_sort', 'desc');
775 791
776 if(!$source_id && !$id){ 792 if(!$source_id && !$id){
777 $this->response('参数异常',Code::SYSTEM_ERROR); 793 $this->response('参数异常',Code::SYSTEM_ERROR);
@@ -814,7 +830,7 @@ class ProjectController extends BaseController @@ -814,7 +830,7 @@ class ProjectController extends BaseController
814 if ($notice_order_id) { 830 if ($notice_order_id) {
815 $query->whereIn('notice_order_id', $notice_order_id); 831 $query->whereIn('notice_order_id', $notice_order_id);
816 } 832 }
817 - })->orderBy('id', 'desc')->paginate($size)->toArray(); 833 + })->orderBy($order_by_field, $order_by_sort)->paginate($size)->toArray();
818 $list = []; 834 $list = [];
819 foreach ($data['list'] as $item){ 835 foreach ($data['list'] as $item){
820 $domain = ''; 836 $domain = '';
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TicketController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/8/11 10:46
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Ticket;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Http\Logic\Aside\Ticket\TicketLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +class TicketController extends BaseController
  18 +{
  19 + public function __construct(Request $request)
  20 + {
  21 + parent::__construct($request);
  22 + $this->logic = new TicketLogic();
  23 + }
  24 +
  25 + /**
  26 + * @remark :统计记录(今日)
  27 + * @name :ticketCount
  28 + * @author :lyh
  29 + * @method :post
  30 + * @time :2025/8/11 10:47
  31 + */
  32 + public function ticketCount(){
  33 + $data['daily'] = $this->logic->getTicketCount();
  34 + $data['list'] = $this->logic->getDailyTicketCount();
  35 + $data['ticket'] = $this->logic->getTicketList();
  36 + $this->response('success',Code::SUCCESS,$data);
  37 + }
  38 +
  39 + /**
  40 + * @remark :技术组
  41 + * @name :manageTicketCount
  42 + * @author :lyh
  43 + * @method :post
  44 + * @time :2025/8/11 14:24
  45 + */
  46 + public function manageTicketCount(){
  47 + $this->request->validate([
  48 + 'dept_id' => 'required',
  49 + ],[
  50 + 'dept_id.required' => '技术组id',
  51 + ]);
  52 + $this->order = 'ticket_num';
  53 + $sort = $this->map['sort'] ?? 'desc';
  54 + $data = $this->logic->getManageTicketCount($this->map,$this->order,$sort);
  55 + $this->response('success',Code::SUCCESS,$data);
  56 + }
  57 +}
@@ -67,13 +67,21 @@ class AsideTicketController extends BaseController @@ -67,13 +67,21 @@ class AsideTicketController extends BaseController
67 }); 67 });
68 }); 68 });
69 }); 69 });
70 - 70 + //TODO::用户部门搜索
  71 + if(isset($this->param['dept_id']) && !empty($this->param['dept_id'])){
  72 + $manageHrModel = new ManageHr();
  73 + $manageIdArr = $manageHrModel->selectField(['dept_id'=>$this->param['dept_id'],'status'=>1],'manage_id');
  74 + $query->whereHas('logs', function ($q) use ($manageIdArr) {
  75 + $q->whereIn('engineer_id', $manageIdArr);
  76 + });
  77 + }
71 // 添加排序功能 78 // 添加排序功能
  79 + $query->orderBy('status', 'asc');
  80 +// $query->orderBy('id', 'desc');
72 $sortField = $request->input('sort_field', 'plan_end_at'); 81 $sortField = $request->input('sort_field', 'plan_end_at');
73 $sortOrder = strtolower($request->input('sort_order', 'asc')); 82 $sortOrder = strtolower($request->input('sort_order', 'asc'));
74 $query->orderBy($sortField, $sortOrder); 83 $query->orderBy($sortField, $sortOrder);
75 - // 添加次要排序:按状态升序排列  
76 - $query->orderBy('status', 'asc'); 84 + if ($sortField != 'plan_end_at') $query->orderBy('plan_end_at', 'asc');
77 $lists = $query->paginate($this->row, ['*'], 'page', $this->page); 85 $lists = $query->paginate($this->row, ['*'], 'page', $this->page);
78 $this->response('success', Code::SUCCESS, $lists); 86 $this->response('success', Code::SUCCESS, $lists);
79 } 87 }
@@ -177,6 +185,7 @@ class AsideTicketController extends BaseController @@ -177,6 +185,7 @@ class AsideTicketController extends BaseController
177 $ticket->star = $request->input('star', 3); 185 $ticket->star = $request->input('star', 3);
178 $ticket->plan_end_at = $request->input('plan_end_at', null); 186 $ticket->plan_end_at = $request->input('plan_end_at', null);
179 $ticket->close_wechat = $request->input('close_wechat', false); 187 $ticket->close_wechat = $request->input('close_wechat', false);
  188 + $ticket->num = $request->input('num', 0);
180 $ticket->save(); 189 $ticket->save();
181 190
182 // 分配工单参与人 191 // 分配工单参与人
@@ -234,13 +243,16 @@ class AsideTicketController extends BaseController @@ -234,13 +243,16 @@ class AsideTicketController extends BaseController
234 $ticket->plan_end_at = $request->input('plan_end_at'); 243 $ticket->plan_end_at = $request->input('plan_end_at');
235 if ($request->input('status')) 244 if ($request->input('status'))
236 $ticket->status = $request->input('status'); 245 $ticket->status = $request->input('status');
  246 + if ($request->input('num'))
  247 + $ticket->num = $request->input('num',0);
237 248
238 if ($ticket->status == Tickets::STATUS_COMPLETED) 249 if ($ticket->status == Tickets::STATUS_COMPLETED)
239 { 250 {
240 // 完成工单,把子任务里面未完成的工单改为完成 251 // 完成工单,把子任务里面未完成的工单改为完成
241 $ticket->end_at = now(); 252 $ticket->end_at = now();
  253 + $ticket->end_time = diffInHours($ticket->created_at,now());
242 $ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED)->where('is_engineer', 1) 254 $ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED)->where('is_engineer', 1)
243 - ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]); 255 + ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now(),'end_time'=>$ticket->end_time]);
244 // 推动微信通知 256 // 推动微信通知
245 $project = $ticket->project; 257 $project = $ticket->project;
246 if ($project->wechat_switch && !$ticket->close_wechat) 258 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})已全部完成,请访问查看详情!");
@@ -178,7 +178,7 @@ class LoginController extends BaseController @@ -178,7 +178,7 @@ class LoginController extends BaseController
178 $wechat = new Wechat(); 178 $wechat = new Wechat();
179 $accessToken = $wechat->getAccessToken(); 179 $accessToken = $wechat->getAccessToken();
180 $data = $wechat->setQrcode('global-v6_'.$this->param['type'].'_'.$this->param['id'],$accessToken); 180 $data = $wechat->setQrcode('global-v6_'.$this->param['type'].'_'.$this->param['id'],$accessToken);
181 - if(!empty($data)){ 181 + if(!empty($data) && isset($data['ticket'])){
182 $data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".$data['ticket']; 182 $data['url'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".$data['ticket'];
183 } 183 }
184 $this->response('success',Code::SUCCESS,$data); 184 $this->response('success',Code::SUCCESS,$data);
@@ -41,13 +41,20 @@ class WebSettingImageController extends BaseController @@ -41,13 +41,20 @@ class WebSettingImageController extends BaseController
41 public function save(WebSettingImage $webSettingImage){ 41 public function save(WebSettingImage $webSettingImage){
42 try { 42 try {
43 foreach ($this->param['data'] as $v){ 43 foreach ($this->param['data'] as $v){
  44 +
44 if(isset($v['id']) && !empty($v['id'])){ 45 if(isset($v['id']) && !empty($v['id'])){
45 $v['image'] = str_replace_url($v['image']); 46 $v['image'] = str_replace_url($v['image']);
46 $webSettingImage->edit($v,['id'=>$v['id']]); 47 $webSettingImage->edit($v,['id'=>$v['id']]);
47 }else{ 48 }else{
48 - $v['project_id'] = $this->user['project_id'];  
49 - $v['image'] = str_replace_url($v['image']);  
50 - $webSettingImage->add($v); 49 + $info = $webSettingImage->read(['type'=>$v['type']],'id');
  50 + if($info === false){
  51 + $v['project_id'] = $this->user['project_id'];
  52 + $v['image'] = str_replace_url($v['image']);
  53 + $webSettingImage->add($v);
  54 + }else{
  55 + $v['image'] = str_replace_url($v['image']);
  56 + $webSettingImage->edit($v,['id'=>$info['id']]);
  57 + }
51 } 58 }
52 } 59 }
53 }catch (\Exception $e){ 60 }catch (\Exception $e){
1 -<?php  
2 -/**  
3 - * @remark :  
4 - * @name :TestController.php  
5 - * @author :lyh  
6 - * @method :post  
7 - * @time :2024/11/5 9:44  
8 - */  
9 -  
10 -namespace App\Http\Controllers\Bside;  
11 -  
12 -use App\Enums\Common\Code;  
13 -use App\Helper\FormGlobalsoApi;  
14 -use App\Helper\PayStripeApi;  
15 -use App\Helper\Translate;  
16 -use App\Http\Logic\Bside\News\NewsLogic;  
17 -use App\Models\Ai\AiBlog;  
18 -use App\Models\Channel\Channel;  
19 -use App\Models\CustomModule\CustomModuleCategory;  
20 -use App\Models\CustomModule\CustomModuleContent;  
21 -use App\Models\CustomModule\CustomModuleExtentContent;  
22 -use App\Models\Domain\DomainInfo;  
23 -use App\Models\ExtentModule\ExtensionModuleValue;  
24 -use App\Models\HomeCount\Count;  
25 -use App\Models\Manage\ManageHr;  
26 -use App\Models\Project\CountAllProject as AllProject;  
27 -use App\Models\Project\Project;  
28 -use App\Models\Project\ProjectAiSetting;  
29 -use App\Models\RouteMap\RouteMap;  
30 -use App\Services\AiBlogService;  
31 -use App\Services\AiVideoService;  
32 -use App\Services\RapIdApIService;  
33 -use App\Services\ProjectServer;  
34 -use Illuminate\Support\Facades\DB;  
35 -  
36 -class TestController extends BaseController  
37 -{  
38 - /**  
39 - * @remark :创建项目  
40 - * @name :createProject  
41 - * @author :lyh  
42 - * @method :post  
43 - * @time :2025/2/13 16:34  
44 - */  
45 - public function ceshi(){  
46 - $hrModel = new ManageHr();  
47 - $data = $hrModel->accordIdGetLeader($this->param['id']);  
48 - $this->response('success',Code::SUCCESS,$data);  
49 - }  
50 -}  
@@ -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
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :TicketLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/8/11 10:54
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Ticket;
  11 +
  12 +use App\Http\Logic\Aside\BaseLogic;
  13 +use App\Models\Manage\ManageHr;
  14 +use App\Models\Project\Project;
  15 +use App\Models\Ticket\TicketDailyCount;
  16 +use App\Models\Ticket\TicketDailyDeptCount;
  17 +use App\Models\Ticket\TicketDailyManageCount;
  18 +use App\Models\WorkOrder\TicketLog;
  19 +use App\Models\WorkOrder\TicketProject;
  20 +use App\Models\WorkOrder\Tickets;
  21 +use Illuminate\Support\Carbon;
  22 +
  23 +class TicketLogic extends BaseLogic
  24 +{
  25 + public function __construct()
  26 + {
  27 + parent::__construct();
  28 + $this->param = $this->requestAll;
  29 + }
  30 +
  31 + /**
  32 + * @remark :获取今日统计数据
  33 + * @name :getTicketCount
  34 + * @author :lyh
  35 + * @method :post
  36 + * @time :2025/8/11 10:54
  37 + */
  38 + public function getTicketCount(){
  39 + $data = [];
  40 + $ticketModel = new Tickets();
  41 + $data['ticket_num'] = $ticketModel->count();//工单总数
  42 + $date = date('Y-m-d');//今日时间
  43 + $data['add_num'] = $ticketModel->counts(['created_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日新增工单
  44 + $data['processed_num'] = $ticketModel->counts(['end_at'=>['between',[$date.' 00:00:00',$date.' 23:59:59']]]);//今日已处理工单
  45 + $data['untreated_num'] = $ticketModel->counts(['end_at'=>null]);//今日未处理工单
  46 + $submit_a_side = $ticketModel->formatQuery(['submit_side'=>1])->sum('submit_side');
  47 + $submit_b_side = $ticketModel->formatQuery(['submit_side'=>2])->sum('submit_side');
  48 + $data['source'] = ['a'=>$submit_a_side,'b'=>$submit_b_side];
  49 + return $this->success($data);
  50 + }
  51 +
  52 + /**
  53 + * @remark :按日统计数据
  54 + * @name :getDailyTicketCount
  55 + * @author :lyh
  56 + * @method :post
  57 + * @time :2025/8/11 10:57
  58 + */
  59 + public function getDailyTicketCount(){
  60 + $date = Carbon::yesterday()->toDateString(); //昨日时间
  61 + $dailyModel = new TicketDailyCount();
  62 + $dailyList = $dailyModel->list([],'date',['*'],'desc',5);//取最近5条数据
  63 + $manageModel = new TicketDailyManageCount();
  64 + $manageList = $manageModel->list(['date'=>$date,'ticket_num'=>['!=',0],'average_time'=>['!=','']],'average_time',['*'],'asc',5);//取最近5条数据
  65 + $deptModel = new TicketDailyDeptCount();
  66 + $deptList = $deptModel->list(['date'=>$date,'ticket_num'=>['!=',0]],'average_time',['*'],'asc',5);
  67 + $data = ['daily'=>$dailyList,'manage'=>$manageList,'dept'=>$deptList];
  68 + return $this->success($data);
  69 + }
  70 +
  71 + /**
  72 + * @remark :获取随机工单列表(20条)
  73 + * @name :ticketList
  74 + * @author :lyh
  75 + * @method :post
  76 + * @time :2025/8/12 11:06
  77 + */
  78 + public function getTicketList(){
  79 + $ticketsList = Tickets::select(['project_id','title','end_at','end_time','id'])->inRandomOrder()->limit(20)->get();
  80 + $projectModel = new TicketProject();
  81 + $ticketLogModel = new TicketLog();
  82 + $manageModel = new ManageHr();
  83 + foreach ($ticketsList as $key => $item){
  84 + $item['project_name'] = $projectModel->getValue(['id'=>$item['project_id']],'title');
  85 + $engineer_id = $ticketLogModel->getValue(['ticket_id'=>$item['id'],'is_engineer'=>1],'engineer_id');
  86 + if(!empty($engineer_id)){
  87 + $item['manage_name'] = $manageModel->getValue(['manage_id'=>$engineer_id],'name');
  88 + }else{
  89 + $item['manage_name'] = '未分配';
  90 + }
  91 + $ticketsList[$key] = $item;
  92 + $item['status'] = (empty($item['end_at']) ? '未完成' : '完成');
  93 + }
  94 + return $this->success($ticketsList);
  95 + }
  96 +
  97 + /**
  98 + * @remark :根据技术组获取
  99 + * @name :getManageTicketCount
  100 + * @author :lyh
  101 + * @method :post
  102 + * @time :2025/8/11 14:41
  103 + */
  104 + public function getManageTicketCount($map,$order = 'ticket_num',$desc = 'desc'){
  105 + $manageModel = new TicketDailyManageCount();
  106 + unset($map['sort']);
  107 + $map['date'] = Carbon::yesterday()->toDateString();
  108 + $manageList = $manageModel->list($map,$order,['*'],$desc);
  109 + return $this->success($manageList);
  110 + }
  111 +
  112 +}
@@ -48,7 +48,7 @@ class GeoQuestionResLogic extends BaseLogic @@ -48,7 +48,7 @@ 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','question','en_question','keywords','url','created_at','updated_at']; 51 + $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','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();
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Http\Logic\Bside\HomeCount; 3 namespace App\Http\Logic\Bside\HomeCount;
4 4
5 5
  6 +use App\Helper\FormGlobalsoApi;
6 use App\Http\Logic\Bside\BaseLogic; 7 use App\Http\Logic\Bside\BaseLogic;
7 use App\Models\Template\BCustomTemplate; 8 use App\Models\Template\BCustomTemplate;
8 use App\Models\Visit\Visit; 9 use App\Models\Visit\Visit;
@@ -14,6 +15,7 @@ use App\Models\Project\Project; @@ -14,6 +15,7 @@ use App\Models\Project\Project;
14 use App\Models\RankData\RankData as RankDataModel; 15 use App\Models\RankData\RankData as RankDataModel;
15 use App\Models\Service\Service; 16 use App\Models\Service\Service;
16 use Carbon\Carbon; 17 use Carbon\Carbon;
  18 +use Illuminate\Support\Facades\Cache;
17 use Illuminate\Support\Facades\DB; 19 use Illuminate\Support\Facades\DB;
18 20
19 class CountLogic extends BaseLogic 21 class CountLogic extends BaseLogic
@@ -41,6 +43,17 @@ class CountLogic extends BaseLogic @@ -41,6 +43,17 @@ class CountLogic extends BaseLogic
41 $info = $this->model->read(['project_id' => $this->user['project_id']], 43 $info = $this->model->read(['project_id' => $this->user['project_id']],
42 ['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']); 44 ['pv_num','ip_num','inquiry_num','date','compliance_day','service_day','country']);
43 } 45 }
  46 + $inquiry_num = Cache::get('inquiry_num_'.$this->user['project_id']);
  47 + if(empty($inquiry_num)){
  48 + $domain = parse_url($this->user['domain'], PHP_URL_HOST); // 直接取域名部分
  49 + $inquiry_list = (new FormGlobalsoApi())->getInquiryAll($domain,$this->user['is_upgrade']);
  50 + if($inquiry_list !== false){
  51 + if($inquiry_list['status'] != 400){
  52 + $info['inquiry_num'] = $inquiry_list['data']['count'];
  53 + Cache::add('inquiry_num_'.$this->user['project_id'],$inquiry_list['data']['count'],3600);
  54 + }
  55 + }
  56 + }
44 //获取项目的剩余时长 57 //获取项目的剩余时长
45 $projectModel = new Project(); 58 $projectModel = new Project();
46 $projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']); 59 $projectInfo = $projectModel->read(['id'=>$this->user['project_id']],['remain_day','finish_remain_day']);
@@ -51,7 +51,11 @@ class TranslateLogic extends BaseLogic @@ -51,7 +51,11 @@ class TranslateLogic extends BaseLogic
51 return $this->success($data); 51 return $this->success($data);
52 } 52 }
53 // 需要校对路由 53 // 需要校对路由
54 - $url = $this->user['domain'] . (($this->param['url'] != '/') ? $this->param['url'] : ''); 54 + if($this->user['project_id'] == 3778){
  55 + $url = $this->user['test_domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
  56 + }else{
  57 + $url = $this->user['domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
  58 + }
55 // 需要校对语种 59 // 需要校对语种
56 $languageInfo = $this->getLanguage($this->param['language_id']); 60 $languageInfo = $this->getLanguage($this->param['language_id']);
57 // 原始校对内容 61 // 原始校对内容
@@ -139,7 +143,11 @@ class TranslateLogic extends BaseLogic @@ -139,7 +143,11 @@ class TranslateLogic extends BaseLogic
139 } 143 }
140 return $this->success($data); 144 return $this->success($data);
141 } 145 }
142 - $url = $this->user['domain'].(($this->param['url'] != '/') ? $this->param['url'] : ''); 146 + if($this->user['project_id'] == 3778){
  147 + $url = $this->user['test_domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
  148 + }else{
  149 + $url = $this->user['domain'] . (($this->param['url'] != '/') ? $this->param['url'] : '');
  150 + }
143 $param = $this->getRouteSource($this->param['url']); 151 $param = $this->getRouteSource($this->param['url']);
144 $param['language_id'] = $this->param['language_id']; 152 $param['language_id'] = $this->param['language_id'];
145 $param['type'] = $this->param['type']; 153 $param['type'] = $this->param['type'];
@@ -292,12 +292,14 @@ class UserLoginLogic @@ -292,12 +292,14 @@ class UserLoginLogic
292 $info['project_location'] = $project['project_location']; 292 $info['project_location'] = $project['project_location'];
293 $info['file_cdn'] = $project['deploy_build']['file_cdn']; 293 $info['file_cdn'] = $project['deploy_build']['file_cdn'];
294 $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; 294 $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0;
  295 + $info['seo_service_duration'] = $project['deploy_build']['seo_service_duration'] ?? 0;
295 $info['is_comment'] = $project['deploy_build']['is_comment'] ?? 0; 296 $info['is_comment'] = $project['deploy_build']['is_comment'] ?? 0;
296 $info['is_ai_blog_send'] = $project['deploy_optimize']['is_ai_blog_send'] ?? 0; 297 $info['is_ai_blog_send'] = $project['deploy_optimize']['is_ai_blog_send'] ?? 0;
297 $info['tech_leader'] = $project['deploy_optimize']['tech_leader'] ?? 0; 298 $info['tech_leader'] = $project['deploy_optimize']['tech_leader'] ?? 0;
298 $manageModel = new ManageHr(); 299 $manageModel = new ManageHr();
299 $info['tech_leader_name'] = $manageModel->getName($project['deploy_optimize']['tech_leader'] ?? 0); 300 $info['tech_leader_name'] = $manageModel->getName($project['deploy_optimize']['tech_leader'] ?? 0);
300 $info['remain_day'] = $project['remain_day'] ?? 0; 301 $info['remain_day'] = $project['remain_day'] ?? 0;
  302 + $info['seo_remain_day'] = $project['seo_remain_day'] ?? 0;
301 $info['project_created_at'] = $project['created_at']; 303 $info['project_created_at'] = $project['created_at'];
302 $info['type'] = $project['type'] ?? 1; 304 $info['type'] = $project['type'] ?? 1;
303 if($info['is_customized'] == 1){ 305 if($info['is_customized'] == 1){
@@ -4,11 +4,13 @@ namespace App\Models\Inquiry; @@ -4,11 +4,13 @@ namespace App\Models\Inquiry;
4 4
5 5
6 use App\Helper\Arr; 6 use App\Helper\Arr;
  7 +use App\Helper\Translate;
7 use App\Models\Base; 8 use App\Models\Base;
8 use App\Utils\HttpUtils; 9 use App\Utils\HttpUtils;
9 use GuzzleHttp\Exception\GuzzleException; 10 use GuzzleHttp\Exception\GuzzleException;
10 use Illuminate\Support\Facades\Cache; 11 use Illuminate\Support\Facades\Cache;
11 use Illuminate\Support\Facades\Http; 12 use Illuminate\Support\Facades\Http;
  13 +use Illuminate\Support\Str;
12 14
13 /** 15 /**
14 * Class InquiryRelateDomain 16 * Class InquiryRelateDomain
@@ -59,6 +61,22 @@ class InquiryRelateDomain extends Base @@ -59,6 +61,22 @@ class InquiryRelateDomain extends Base
59 } 61 }
60 Cache::put($list_cache_key, $data, 3600); 62 Cache::put($list_cache_key, $data, 3600);
61 } 63 }
  64 + if(empty($data[$domain])){
  65 + $domainPrefix = explode(".",$domain);
  66 + if (!empty($domainPrefix)){
  67 + if($domainPrefix[0] == 'm'){
  68 + $domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
  69 + }else{
  70 + $isLang = Translate::getTls($domainPrefix[0]);
  71 + if ($isLang) {
  72 + $domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
  73 + }
  74 + }
  75 + }
  76 + if(!Str::startsWith($domain, 'www')){
  77 + $domain = 'www.' . $domain;
  78 + }
  79 + }
62 return $data[$domain]??''; 80 return $data[$domain]??'';
63 } 81 }
64 } 82 }
@@ -44,7 +44,10 @@ class AiVideoTask extends Base @@ -44,7 +44,10 @@ class AiVideoTask extends Base
44 */ 44 */
45 public function videoFrequency(){ 45 public function videoFrequency(){
46 return [ 46 return [
47 - 1 => '5-7', 47 + 1 => '3-4',
  48 + 2 => '5-7',
  49 + 3 => '7-10',
  50 + 2 => '10-15',
48 ]; 51 ];
49 } 52 }
50 } 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\Helper\Arr;
  13 +use App\Models\Base;
  14 +
  15 +/**
  16 + * @remark :工单日统计
  17 + * @name :TicketDailyCount
  18 + * @author :lyh
  19 + * @method :post
  20 + * @time :2025/8/7 17:51
  21 + */
  22 +class TicketDailyCount extends Base
  23 +{
  24 + protected $table = 'gl_ticket_daily_count';
  25 +
  26 + public function getSourceAttribute($value)
  27 + {
  28 + return Arr::s2a($value);
  29 + }
  30 +
  31 + public function getSourceTypeAttribute($value)
  32 + {
  33 + return Arr::s2a($value);
  34 + }
  35 +}
  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 +}
@@ -84,6 +84,7 @@ class Tickets extends Base @@ -84,6 +84,7 @@ class Tickets extends Base
84 if ($log && $log->is_engineer != in_array($engineer_id, $engineer_ids)) 84 if ($log && $log->is_engineer != in_array($engineer_id, $engineer_ids))
85 { 85 {
86 $log->is_engineer = in_array($engineer_id, $engineer_ids); 86 $log->is_engineer = in_array($engineer_id, $engineer_ids);
  87 + $log->plan_end_at = $this->plan_end_at; // 新增时写入 plan_end_at
87 $log->save(); 88 $log->save();
88 }else 89 }else
89 { 90 {
@@ -91,6 +92,7 @@ class Tickets extends Base @@ -91,6 +92,7 @@ class Tickets extends Base
91 $log = new TicketLog(); 92 $log = new TicketLog();
92 $log->engineer_id = $engineer_id; 93 $log->engineer_id = $engineer_id;
93 $log->is_engineer = in_array($engineer_id, $engineer_ids); 94 $log->is_engineer = in_array($engineer_id, $engineer_ids);
  95 + $log->plan_end_at = $this->plan_end_at; // 新增时写入 plan_end_at
94 $this->logs()->save($log); 96 $this->logs()->save($log);
95 } 97 }
96 }catch (\Exception $exception){ 98 }catch (\Exception $exception){
@@ -27,7 +27,7 @@ class MessagePush extends Base @@ -27,7 +27,7 @@ class MessagePush extends Base
27 27
28 const TYPE_INQUIRY = 'inquiry'; 28 const TYPE_INQUIRY = 'inquiry';
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 //设置关联表名 32 //设置关联表名
33 /** 33 /**
@@ -632,7 +632,11 @@ Route::middleware(['aloginauth'])->group(function () { @@ -632,7 +632,11 @@ Route::middleware(['aloginauth'])->group(function () {
632 // 流量统计 632 // 流量统计
633 Route::any('/flow', [Aside\Project\StatisticsController::class, 'flow'])->name('admin.statistics_flow'); 633 Route::any('/flow', [Aside\Project\StatisticsController::class, 'flow'])->name('admin.statistics_flow');
634 }); 634 });
635 - 635 + //ticket
  636 + Route::prefix('ticket_count')->group(function () {
  637 + Route::any('/ticketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'ticketCount'])->name('ticket_count_ticketCount');
  638 + Route::any('/manageTicketCount', [\App\Http\Controllers\Aside\Ticket\TicketController::class,'manageTicketCount'])->name('ticket_count_manageTicketCount');
  639 + });
636 }); 640 });
637 641
638 //无需登录验证的路由组 642 //无需登录验证的路由组