作者 赵彬吉
正在显示 31 个修改的文件 包含 551 行增加348 行删除
@@ -68,12 +68,29 @@ class UpdateRoute extends Command @@ -68,12 +68,29 @@ class UpdateRoute extends Command
68 */ 68 */
69 public function handle() 69 public function handle()
70 { 70 {
71 - ProjectServer::useProject(1181);  
72 - return $this->setProductKeyword(); 71 + ProjectServer::useProject(4132);
  72 + return $this->product_action(4132);
73 DB::disconnect('custom_mysql'); 73 DB::disconnect('custom_mysql');
74 } 74 }
75 75
76 /** 76 /**
  77 + * @remark :执行所有产品的路由
  78 + * @name :product_action
  79 + * @author :lyh
  80 + * @method :post
  81 + * @time :2025/6/21 17:29
  82 + */
  83 + public function product_action($project_id){
  84 + $productModel = new Product();
  85 + $lists = $productModel->list([],'id',['id','title','route']);
  86 + foreach ($lists as $item){
  87 + $route = RouteMap::setRoute($item['title'],RouteMap::SOURCE_PRODUCT,$item['id'],$project_id);
  88 + $productModel->edit(['route'=>$route],['id'=>$item['id']]);
  89 + }
  90 + return true;
  91 + }
  92 +
  93 + /**
77 * @remark :查询 路由为空的关键词项目id 94 * @remark :查询 路由为空的关键词项目id
78 * @name :getNullRoute 95 * @name :getNullRoute
79 * @author :lyh 96 * @author :lyh
@@ -170,32 +187,6 @@ class UpdateRoute extends Command @@ -170,32 +187,6 @@ class UpdateRoute extends Command
170 return true; 187 return true;
171 } 188 }
172 189
173 -// $this->updateProjectOp();  
174 -// $projectModel = new Project();  
175 -// $lists = $projectModel->list(['delete_status'=>0],'id',['id']);  
176 -// foreach ($lists as $v){  
177 -// echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;  
178 -// ProjectServer::useProject($v['id']);  
179 -// $webSettingModel = new WebSetting();  
180 -// $settingInfo = $webSettingModel->read(['project_id'=>$v['id']]);  
181 -// if($settingInfo === false){  
182 -// echo date('Y-m-d H:i:s') . '当前项目的设置数据不存在:'.$v['id'] . PHP_EOL;  
183 -// //新增一条数据  
184 -// $data = [  
185 -// 'anchor_setting'=>'["3","4","5"]',  
186 -// 'anchor_is_enable'=>1,  
187 -// 'anchor_page_num'=>1,  
188 -// 'anchor_num'=>2,  
189 -// 'anchor_keyword_is_enable'=>1,  
190 -// 'project_id'=>$v['id']  
191 -// ];  
192 -// $webSettingModel->add($data);  
193 -// }  
194 -// DB::disconnect('custom_mysql');  
195 -// }  
196 -// echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;  
197 -// }  
198 -  
199 /** 190 /**
200 * @remark :更新产品 191 * @remark :更新产品
201 * @name :updateProduct 192 * @name :updateProduct
@@ -9,37 +9,19 @@ @@ -9,37 +9,19 @@
9 9
10 namespace App\Console\Commands\LyhTest; 10 namespace App\Console\Commands\LyhTest;
11 11
12 -use App\Console\Commands\Domain\DomainInfo;  
13 -use App\Helper\OaGlobalsoApi;  
14 -use App\Http\Logic\Aside\Project\ProjectLogic;  
15 use App\Models\Ai\AiBlog; 12 use App\Models\Ai\AiBlog;
16 -use App\Models\Ai\AiBlogAuthor;  
17 -use App\Models\Ai\AiCommand;  
18 -use App\Models\Com\NoticeLog;  
19 -use App\Models\Com\V6WeeklyReport;  
20 use App\Models\Product\Category; 13 use App\Models\Product\Category;
21 use App\Models\Project\AggregateKeywordAffix; 14 use App\Models\Project\AggregateKeywordAffix;
22 use App\Models\Project\AiBlogTask; 15 use App\Models\Project\AiBlogTask;
23 -use App\Models\Project\DeployBuild;  
24 -use App\Models\Project\DeployOptimize;  
25 -use App\Models\Project\OnlineCheck; 16 +use App\Models\Project\KeywordPrefix;
26 use App\Models\Project\Project; 17 use App\Models\Project\Project;
27 use App\Models\Project\ProjectAiSetting; 18 use App\Models\Project\ProjectAiSetting;
28 -use App\Models\ProjectAssociation\ProjectAssociation;  
29 -use App\Models\RouteMap\RouteMap; 19 +use App\Models\Project\ProjectWhiteHatAffix;
30 use App\Models\Template\BTemplateMain; 20 use App\Models\Template\BTemplateMain;
31 use App\Models\Template\TemplateTypeMain; 21 use App\Models\Template\TemplateTypeMain;
32 -use App\Models\Visit\Visit;  
33 -use App\Models\WebSetting\TranslateBigProject;  
34 -use App\Models\WebSetting\WebLanguage;  
35 -use App\Models\WebSetting\WebSetting;  
36 -use App\Models\Workchat\MessagePush;  
37 use App\Services\AiBlogService; 22 use App\Services\AiBlogService;
38 -use App\Services\AiCommandService;  
39 use App\Services\ProjectServer; 23 use App\Services\ProjectServer;
40 use Illuminate\Console\Command; 24 use Illuminate\Console\Command;
41 -use Illuminate\Support\Facades\Schema;  
42 -use Illuminate\Support\Facades\Artisan;  
43 use Illuminate\Support\Facades\DB; 25 use Illuminate\Support\Facades\DB;
44 26
45 class lyhDemo extends Command 27 class lyhDemo extends Command
@@ -59,20 +41,18 @@ class lyhDemo extends Command @@ -59,20 +41,18 @@ class lyhDemo extends Command
59 protected $description = '更新路由'; 41 protected $description = '更新路由';
60 42
61 public function handle(){ 43 public function handle(){
62 - $aggregateKeywordAffixModel = new AggregateKeywordAffix();  
63 - $info = $aggregateKeywordAffixModel->read(['project_id'=>3298]);  
64 - $projectModel = new Project();  
65 - $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>2], 'id', ['id']);  
66 - foreach ($lists as $item){  
67 - if(in_array($item['id'],[467,110,3298])){  
68 - continue;  
69 - } 44 + //获取
  45 + $keywordPrefixModel = new KeywordPrefix();
  46 + $lists = $keywordPrefixModel->list(['project_id'=>0,'id'=>['<',29]]);
  47 + $whiteModel = new ProjectWhiteHatAffix();
  48 + foreach ($lists as $val) {
  49 + echo date('Y-m-d H:i:s') . '开始--项目的id:' . $val['id'] . PHP_EOL;
70 $data = [ 50 $data = [
71 - 'project_id'=>$item['id'],  
72 - 'prefix'=>$info['prefix'],  
73 - 'suffix'=>$info['suffix'] 51 + 'project_id'=>0,
  52 + 'name'=>$val['keyword'],
  53 + 'type'=>$val['type'],
74 ]; 54 ];
75 - $aggregateKeywordAffixModel->addReturnId($data); 55 + $whiteModel->add($data);
76 } 56 }
77 return true; 57 return true;
78 } 58 }
@@ -36,7 +36,14 @@ class InitKeywordComment extends Command @@ -36,7 +36,14 @@ class InitKeywordComment extends Command
36 public $number = 100; 36 public $number = 100;
37 37
38 public function handle(){ 38 public function handle(){
39 - return $this->_action(467); 39 + $projectModel = new Project();
  40 + $lists = $projectModel->list(['delete_status' => 0,'id'=>['<',1368],'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
  41 + foreach ($lists as $val) {
  42 + echo date('Y-m-d H:i:s') . '开始--项目的id:' . $val['id'] . PHP_EOL;
  43 + $this->_action($val['id']);
  44 + }
  45 + return true;
  46 + $keywordCommentModel = new AggregateKeywordComment();
40 while (true){ 47 while (true){
41 $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMON)->where('status', NoticeLog::STATUS_PENDING)->get(); 48 $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_KEYWORD_COMMON)->where('status', NoticeLog::STATUS_PENDING)->get();
42 if(empty($list)){ 49 if(empty($list)){
@@ -49,7 +56,7 @@ class InitKeywordComment extends Command @@ -49,7 +56,7 @@ class InitKeywordComment extends Command
49 echo date('Y-m-d H:i:s').'执行的项目id:' . $project_id . PHP_EOL; 56 echo date('Y-m-d H:i:s').'执行的项目id:' . $project_id . PHP_EOL;
50 try { 57 try {
51 $this->_action($project_id); 58 $this->_action($project_id);
52 - $count = $keywordCommonModel->counts(['project_id'=>$project_id]); 59 + $count = $keywordCommentModel->counts(['project_id'=>$project_id]);
53 if($count > 100){ 60 if($count > 100){
54 $item->status = NoticeLog::STATUS_SUCCESS; 61 $item->status = NoticeLog::STATUS_SUCCESS;
55 $item->save(); 62 $item->save();
@@ -86,18 +93,22 @@ class InitKeywordComment extends Command @@ -86,18 +93,22 @@ class InitKeywordComment extends Command
86 if(!isset($item['name']) || !isset($item['comment'])){ 93 if(!isset($item['name']) || !isset($item['comment'])){
87 continue; 94 continue;
88 } 95 }
  96 + $twoMonthsAgo = strtotime('-2 months');
  97 + $randomTimestamp = rand($twoMonthsAgo, time());
  98 + $randomDateTime = date('Y-m-d H:i:s', $randomTimestamp);
89 $data[] = [ 99 $data[] = [
90 'nickname'=>$item['name'], 100 'nickname'=>$item['name'],
91 'text'=>$item['comment'], 101 'text'=>$item['comment'],
92 'project_id'=>$project_id, 102 'project_id'=>$project_id,
93 'type'=>1, 103 'type'=>1,
94 'uid'=>0, 104 'uid'=>0,
  105 + 'start_time'=>$randomDateTime,
95 'created_at'=>date('Y-m-d H:i:s'), 106 'created_at'=>date('Y-m-d H:i:s'),
96 'updated_at'=>date('Y-m-d H:i:s') 107 'updated_at'=>date('Y-m-d H:i:s')
97 ]; 108 ];
98 } 109 }
99 - $keywordCommonModel = new AggregateKeywordComment();  
100 - $keywordCommonModel->insertAll($data); 110 + $keywordCommentModel = new AggregateKeywordComment();
  111 + $keywordCommentModel->insertAll($data);
101 } 112 }
102 return true; 113 return true;
103 } 114 }
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: Akun
  5 + * Date: 2025/06/121
  6 + */
  7 +
  8 +namespace App\Console\Commands\Test;
  9 +
  10 +use App\Models\Product\StockData;
  11 +use App\Services\ProjectServer;
  12 +use Illuminate\Console\Command;
  13 +
  14 +/**
  15 + * Class CreateUpdatePageMaster
  16 + * @package App\Console\Commands
  17 + */
  18 +class HyStockData extends Command
  19 +{
  20 + /**
  21 + * The name and signature of the console command.
  22 + *
  23 + * @var string
  24 + */
  25 + protected $signature = 'hy_stock_data';
  26 +
  27 + /**
  28 + * The console command description.
  29 + *
  30 + * @var string
  31 + */
  32 + protected $description = '翰宇药业中文站股票信息获取';
  33 +
  34 +
  35 + public function handle()
  36 + {
  37 + $hour = date('H');
  38 + $min = date('i');
  39 +
  40 + //9:30 - 11:30 , 13:00 - 15:00
  41 + if (($hour == 9 && $min > 15) || $hour == 10 || ($hour == 11 && $min < 45) || $hour == 13 || $hour == 14 || ($hour == 15 && $min < 15)) {
  42 + sleep(30);
  43 + $this->get_stock();
  44 + }
  45 + }
  46 +
  47 + public function get_stock()
  48 + {
  49 + //翰宇药业项目id
  50 + $project_id = 3531;
  51 + //流通股数量
  52 + $all_stock_num = 745000000;
  53 +
  54 + // 连接数据库
  55 + $project = ProjectServer::useProject($project_id);
  56 + if ($project) {
  57 +
  58 + // 基本参数配置
  59 + $apiUrl = "http://web.juhe.cn/finance/stock/hs"; // 接口请求URL
  60 + $method = "GET"; // 接口请求方式
  61 + $headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
  62 + $apiKey = "f6d2a89b4049c3400b5d1059deb320bf"; // 在个人中心->我的数据,接口名称上方查看
  63 + // 接口请求入参配置
  64 + $requestParams = [
  65 + 'key' => $apiKey,
  66 + 'gid' => 'sz300199',
  67 + 'type' => '',
  68 + ];
  69 + $requestParamsStr = http_build_query($requestParams);
  70 +
  71 + // 发起接口网络请求
  72 + $curl = curl_init();
  73 + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
  74 + curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
  75 + curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  76 + curl_setopt($curl, CURLOPT_FAILONERROR, false);
  77 + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  78 + if (1 == strpos("$" . $apiUrl, "https://")) {
  79 + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  80 + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  81 + }
  82 + $response = curl_exec($curl);
  83 + curl_close($curl);
  84 +
  85 + // 解析响应结果
  86 + $responseResult = json_decode($response, true);
  87 + if ($responseResult) {
  88 + $data = $responseResult['result'][0]['data'];
  89 + if ($data) {
  90 + //获取最近一条
  91 + $stock = StockData::orderBy('id', 'desc')->first();
  92 + if (empty($stock) || $data['date'] > $stock->today_date) {
  93 + //新增当日数据
  94 + $stock = new StockData();
  95 + $stock->today_date = $data['date'];
  96 + $stock->today_time = $data['time'];
  97 + $stock->now_pri = $data['nowPri'];
  98 + $stock->increase = $data['increase'];
  99 + $stock->incre_per = $data['increPer'];
  100 + $stock->today_max = $data['todayMax'];
  101 + $stock->today_min = $data['todayMin'];
  102 + $stock->today_start_pri = $data['todayStartPri'];
  103 + $stock->yestod_end_pri = $data['yestodEndPri'];
  104 + $stock->tra_number = $data['traNumber'];
  105 + $stock->tra_amount = $data['traAmount'];
  106 + $stock->change_per = floor(($data['traNumber'] / $all_stock_num) * 10000) / 100;
  107 + $stock->save();
  108 + } elseif ($data['date'] == $stock['today_date'] && $data['time'] > $stock['today_time']) {
  109 + //当日数据更新
  110 + $stock->today_time = $data['time'];
  111 + $stock->now_pri = $data['nowPri'];
  112 + $stock->increase = $data['increase'];
  113 + $stock->incre_per = $data['increPer'];
  114 + $stock->today_max = $data['todayMax'];
  115 + $stock->today_min = $data['todayMin'];
  116 + $stock->today_start_pri = $data['todayStartPri'];
  117 + $stock->yestod_end_pri = $data['yestodEndPri'];
  118 + $stock->tra_number = $data['traNumber'];
  119 + $stock->tra_amount = $data['traAmount'];
  120 + $stock->change_per = floor(($data['traNumber'] / $all_stock_num) * 10000) / 100;
  121 + $stock->save();
  122 + }
  123 +
  124 + $this->output('数据更新成功');
  125 + } else {
  126 + $this->output('数据为空');
  127 + }
  128 + } else {
  129 + $this->output('请求异常');
  130 + }
  131 + } else {
  132 + $this->output('数据库链接失败');
  133 + }
  134 + }
  135 +
  136 + /**
  137 + * 输出处理日志
  138 + * @param $message
  139 + * @return bool
  140 + */
  141 + public function output($message)
  142 + {
  143 + echo date('Y-m-d H:i:s') . ' | ' . $message . PHP_EOL;
  144 + return true;
  145 + }
  146 +}
@@ -156,6 +156,10 @@ class HtmlCollect extends Command @@ -156,6 +156,10 @@ class HtmlCollect extends Command
156 return true; 156 return true;
157 } 157 }
158 158
  159 + if ($project_id == 437) {
  160 + //437项目单词替换
  161 + $html = str_replace('Forenia', 'Tourle', $html);
  162 + }
159 $collect_info->html = $html; 163 $collect_info->html = $html;
160 $collect_info->status = CollectTask::STATUS_COM; 164 $collect_info->status = CollectTask::STATUS_COM;
161 $collect_info->save(); 165 $collect_info->save();
@@ -123,13 +123,20 @@ class ProjectUpdate extends Command @@ -123,13 +123,20 @@ class ProjectUpdate extends Command
123 $page_list = array_column($data_page, 'path'); 123 $page_list = array_column($data_page, 'path');
124 } 124 }
125 125
  126 + //获取需要替换的内容
  127 + $replace = [];
  128 + if ($project_id == 437) {
  129 + //437项目单词替换
  130 + $replace = ['Forenia' => 'Tourle'];
  131 + }
  132 +
126 //设置数据库 133 //设置数据库
127 $project = ProjectServer::useProject($project_id); 134 $project = ProjectServer::useProject($project_id);
128 if ($project) { 135 if ($project) {
129 if ($api_type == 'category') { 136 if ($api_type == 'category') {
130 //产品分类 137 //产品分类
131 $url = $api_url . '?' . http_build_query(['w' => 'category']); 138 $url = $api_url . '?' . http_build_query(['w' => 'category']);
132 - $data = curl_c($url); 139 + $data = curl_c($url, true, $replace);
133 if (isset($data['code']) && $data['code'] == 200) { 140 if (isset($data['code']) && $data['code'] == 200) {
134 $items = $data['data'] ?? []; 141 $items = $data['data'] ?? [];
135 $this->category_insert($project_id, $items, 0, $domain_arr['host'], $web_url_domain, $home_url); 142 $this->category_insert($project_id, $items, 0, $domain_arr['host'], $web_url_domain, $home_url);
@@ -139,7 +146,7 @@ class ProjectUpdate extends Command @@ -139,7 +146,7 @@ class ProjectUpdate extends Command
139 } elseif ($api_type == 'category_news') { 146 } elseif ($api_type == 'category_news') {
140 // 新闻分类 147 // 新闻分类
141 $url = $api_url . '?' . http_build_query(['w' => 'category_news']); 148 $url = $api_url . '?' . http_build_query(['w' => 'category_news']);
142 - $data = curl_c($url); 149 + $data = curl_c($url, true, $replace);
143 if (isset($data['code']) && $data['code'] == 200) { 150 if (isset($data['code']) && $data['code'] == 200) {
144 $items = $data['data'] ?? []; 151 $items = $data['data'] ?? [];
145 $this->category_news_insert($project_id, $items, 0); 152 $this->category_news_insert($project_id, $items, 0);
@@ -156,7 +163,7 @@ class ProjectUpdate extends Command @@ -156,7 +163,7 @@ class ProjectUpdate extends Command
156 $total_page = ceil($count / $page_size); 163 $total_page = ceil($count / $page_size);
157 for ($page = 1; $page <= $total_page; $page++) { 164 for ($page = 1; $page <= $total_page; $page++) {
158 $url_page = $api_url . '?' . http_build_query(['w' => 'tag', 'page' => $page, 'pagesize' => $page_size]); 165 $url_page = $api_url . '?' . http_build_query(['w' => 'tag', 'page' => $page, 'pagesize' => $page_size]);
159 - $data_page = curl_c($url_page); 166 + $data_page = curl_c($url_page, true, $replace);
160 if (isset($data_page['code']) && $data_page['code'] == 200) { 167 if (isset($data_page['code']) && $data_page['code'] == 200) {
161 $items = $data_page['data']['data'] ?? []; 168 $items = $data_page['data']['data'] ?? [];
162 169
@@ -287,7 +294,7 @@ class ProjectUpdate extends Command @@ -287,7 +294,7 @@ class ProjectUpdate extends Command
287 $total_page = ceil($count / $page_size); 294 $total_page = ceil($count / $page_size);
288 for ($page = 1; $page <= $total_page; $page++) { 295 for ($page = 1; $page <= $total_page; $page++) {
289 $url_page = $api_url . '?' . http_build_query(['w' => 'post', 'page' => $page, 'pagesize' => $page_size]); 296 $url_page = $api_url . '?' . http_build_query(['w' => 'post', 'page' => $page, 'pagesize' => $page_size]);
290 - $data_page = curl_c($url_page); 297 + $data_page = curl_c($url_page, true, $replace);
291 if (isset($data_page['code']) && $data_page['code'] == 200) { 298 if (isset($data_page['code']) && $data_page['code'] == 200) {
292 $items = $data_page['data']['data'] ?? []; 299 $items = $data_page['data']['data'] ?? [];
293 300
@@ -522,7 +529,7 @@ class ProjectUpdate extends Command @@ -522,7 +529,7 @@ class ProjectUpdate extends Command
522 $total_page = ceil($count / $page_size); 529 $total_page = ceil($count / $page_size);
523 for ($page = 1; $page <= $total_page; $page++) { 530 for ($page = 1; $page <= $total_page; $page++) {
524 $url_page = $api_url . '?' . http_build_query(['w' => $api_type, 'page' => $page, 'pagesize' => $page_size]); 531 $url_page = $api_url . '?' . http_build_query(['w' => $api_type, 'page' => $page, 'pagesize' => $page_size]);
525 - $data_page = curl_c($url_page); 532 + $data_page = curl_c($url_page, true, $replace);
526 if (isset($data_page['code']) && $data_page['code'] == 200) { 533 if (isset($data_page['code']) && $data_page['code'] == 200) {
527 $items = $data_page['data']['data'] ?? []; 534 $items = $data_page['data']['data'] ?? [];
528 535
@@ -616,7 +623,7 @@ class ProjectUpdate extends Command @@ -616,7 +623,7 @@ class ProjectUpdate extends Command
616 $total_page = ceil($count / $page_size); 623 $total_page = ceil($count / $page_size);
617 for ($page = 1; $page <= $total_page; $page++) { 624 for ($page = 1; $page <= $total_page; $page++) {
618 $url_page = $api_url . '?' . http_build_query(['w' => 'page', 'page' => $page, 'pagesize' => $page_size]); 625 $url_page = $api_url . '?' . http_build_query(['w' => 'page', 'page' => $page, 'pagesize' => $page_size]);
619 - $data_page = curl_c($url_page); 626 + $data_page = curl_c($url_page, true, $replace);
620 if (isset($data_page['code']) && $data_page['code'] == 200) { 627 if (isset($data_page['code']) && $data_page['code'] == 200) {
621 $items = $data_page['data']['data'] ?? []; 628 $items = $data_page['data']['data'] ?? [];
622 629
@@ -706,7 +713,7 @@ class ProjectUpdate extends Command @@ -706,7 +713,7 @@ class ProjectUpdate extends Command
706 $total_page = ceil($count / $page_size); 713 $total_page = ceil($count / $page_size);
707 for ($page = 1; $page <= $total_page; $page++) { 714 for ($page = 1; $page <= $total_page; $page++) {
708 $url_page = $api_url . '?' . http_build_query(['w' => $api_type, 'page' => $page, 'pagesize' => $page_size]); 715 $url_page = $api_url . '?' . http_build_query(['w' => $api_type, 'page' => $page, 'pagesize' => $page_size]);
709 - $data_page = curl_c($url_page); 716 + $data_page = curl_c($url_page, true, $replace);
710 if (isset($data_page['code']) && $data_page['code'] == 200) { 717 if (isset($data_page['code']) && $data_page['code'] == 200) {
711 $items = $data_page['data']['data'] ?? []; 718 $items = $data_page['data']['data'] ?? [];
712 719
@@ -15,7 +15,7 @@ class FetchTicketProjects extends Command @@ -15,7 +15,7 @@ class FetchTicketProjects extends Command
15 * 15 *
16 * @var string 16 * @var string
17 */ 17 */
18 - protected $signature = 'workorder:fetch-ticket-projects {version}'; 18 + protected $signature = 'workorder:fetch-ticket-projects {action}}';
19 19
20 /** 20 /**
21 * The console command description. 21 * The console command description.
@@ -41,15 +41,8 @@ class FetchTicketProjects extends Command @@ -41,15 +41,8 @@ class FetchTicketProjects extends Command
41 */ 41 */
42 public function handle() 42 public function handle()
43 { 43 {
44 - $version = $this->argument('version');  
45 - if ($version == 'v5') {  
46 - $this->fetch_v5();  
47 - } elseif ($version == 'v6') {  
48 - $this->fetch_v6();  
49 - } else {  
50 - $this->error('Invalid action. Use "v5" or "v6".');  
51 - return 1;  
52 - } 44 + $action = $this->argument('action');
  45 + $this->$action();
53 return 0; 46 return 0;
54 } 47 }
55 48
@@ -58,7 +51,7 @@ class FetchTicketProjects extends Command @@ -58,7 +51,7 @@ class FetchTicketProjects extends Command
58 * @return void 51 * @return void
59 * 请求:https://www.quanqiusou.cn/extend_api/webs/globalso_all.php 52 * 请求:https://www.quanqiusou.cn/extend_api/webs/globalso_all.php
60 */ 53 */
61 - public function fetch_v5() 54 + public function fetchV5()
62 { 55 {
63 # pm 项目经理 assm 售后服务经理 56 # pm 项目经理 assm 售后服务经理
64 $response = Http::get('https://www.quanqiusou.cn/extend_api/webs/globalso_all.php'); 57 $response = Http::get('https://www.quanqiusou.cn/extend_api/webs/globalso_all.php');
@@ -68,22 +61,25 @@ class FetchTicketProjects extends Command @@ -68,22 +61,25 @@ class FetchTicketProjects extends Command
68 # V5: 版本号+postid 61 # V5: 版本号+postid
69 $uuid = md5("V5{$item['postid']}"); 62 $uuid = md5("V5{$item['postid']}");
70 $project = TicketProject::where('uuid', $uuid)->first(); 63 $project = TicketProject::where('uuid', $uuid)->first();
71 -  
72 - $item['pm'] = $item['pm'] == '未安排' ? '杨长远' : $item['pm'];  
73 - $item['assm'] = $item['assm'] == '未安排' ? '杨长远' : $item['assm'];  
74 - $item['yhs'] = $item['yhs'] == '未安排' ? '杨长远' : $item['yhs'];  
75 -  
76 - // 如果 $item['cate'] 包含”推广“字符,则$engineer_name = $item['assm']  
77 - $engineer_name = (strpos($item['cate'], '推广') !== false) ? $item['yhs'] : $item['assm']; 64 + $assm_id = Manage::where('name', $item['assm'])->value('id') ?? Manage::where('name', '张鸿飞')->value('id') ?? 0; //售后服务经理
  65 + $seom_id = Manage::where('name', $item['yhs'])->value('id') ?? Manage::where('name', '陶婵')->value('id') ?? 0; //优化师
  66 + // 如果 $item['cate'] 包含”推广“字符,则 $engineer_name = $item['assm']
  67 + /**
  68 + * 第一负责人逻即说明:
  69 + * 优化推广项目:找售后服务经理??鸿飞
  70 + * 建站类项目: 找杨长远
  71 + */
  72 + $engineer_id = (strpos($item['cate'], '推广') !== false) ? $assm_id : Manage::where('name', '杨长远')->value('id') ?? 0;
78 73
79 $fields = [ 74 $fields = [
80 - 'post_id' => $item['postid'],  
81 - 'company_name' => $item['company'],  
82 - 'title' => $item['title'],  
83 - 'engineer_id' => Manage::where('name', $engineer_name)->value('id') ?? 0, // 第一负责人  
84 - 'assm_id' => Manage::where('name', $item['assm'])->value('id') ?? 0, //售后服务经理  
85 - 'seom_id' => Manage::where('name', $item['yhs'])->value('id') ?? 0, //售后服务经理  
86 - 'website' => $item['main_url'] ?? '', 75 + 'post_id' => $item['postid'],
  76 + 'company_name' => $item['company'],
  77 + 'title' => $item['title'],
  78 + 'engineer_id' => $engineer_id, // 第一负责人
  79 + 'assm_id' => $assm_id,
  80 + 'seom_id' => $seom_id,
  81 + 'website' => $item['main_url'] ?? '',
  82 + 'is_del' => 0,
87 ]; 83 ];
88 if (!$project) { 84 if (!$project) {
89 $new = new TicketProject(); 85 $new = new TicketProject();
@@ -106,8 +102,13 @@ class FetchTicketProjects extends Command @@ -106,8 +102,13 @@ class FetchTicketProjects extends Command
106 $project->save(); 102 $project->save();
107 } 103 }
108 } 104 }
109 - echo "V5: {$item['postid']} - {$item['title']} - {$item['company']} - {$item['main_url']}\n";  
110 } 105 }
  106 + $postids = collect($items)->pluck('postid')->toArray();
  107 + // 软删除 gl_ticket_projects 中不存在的项目
  108 + TicketProject::where('version', 5)
  109 + ->whereNotIn('post_id', $postids)
  110 + ->update(['is_del' => 1]);
  111 + echo date("Y-m-d H:i:s") . " V5: fetch completed, total " . count($items) . " items\n";
111 } 112 }
112 } 113 }
113 114
@@ -116,12 +117,15 @@ class FetchTicketProjects extends Command @@ -116,12 +117,15 @@ class FetchTicketProjects extends Command
116 * 1. 按照ID升序查询 gl_project 表 limit 10 117 * 1. 按照ID升序查询 gl_project 表 limit 10
117 * 2。同步到 TicketProject 后,redis 缓存 ID 118 * 2。同步到 TicketProject 后,redis 缓存 ID
118 */ 119 */
119 - public function fetch_v6() 120 + public function fetchV6()
120 { 121 {
121 $lastid = 0; 122 $lastid = 0;
122 while (true) { 123 while (true) {
123 try { 124 try {
124 $items = Project::where('id', '>', intval($lastid)) 125 $items = Project::where('id', '>', intval($lastid))
  126 +// ->where('delete_status', 0)
  127 +// ->where('extend_type', '!=', 5) // 排除归档项目
  128 +// ->where('type', '!=', 8) // 排除归档项目
125 ->orderBy('id', 'asc') 129 ->orderBy('id', 'asc')
126 ->limit(10) 130 ->limit(10)
127 ->get(); 131 ->get();
@@ -130,16 +134,46 @@ class FetchTicketProjects extends Command @@ -130,16 +134,46 @@ class FetchTicketProjects extends Command
130 break; 134 break;
131 } 135 }
132 foreach ($items as $item) { 136 foreach ($items as $item) {
133 - $uuid = md5("V5{$item->id}"); 137 + $uuid = md5("V6{$item->id}");
134 $project = TicketProject::where('uuid', $uuid)->first(); 138 $project = TicketProject::where('uuid', $uuid)->first();
  139 + // 售后服务经理
  140 + $assm_id = collect([
  141 + $item->deploy_optimize->manager_mid ?? 0,
  142 + $item->deploy_optimize->tech_leader ?? 0,
  143 + 8, //张鸿飞
  144 + ])->first(fn($v) => $v !== null && $v !== 0, 0);
  145 + $seom_id = !empty($item->deploy_optimize->optimist_mid) ? $item->deploy_optimize->optimist_mid : $assm_id;
  146 + /**
  147 + * 第一负责人逻辑
  148 + * 建站类项目:找杨长远
  149 + * 推广类:找售后
  150 + */
  151 + if (in_array($item->type, [Project::TYPE_TWO, Project::TYPE_FOUR, Project::TYPE_SIX])) {
  152 + // 优化推广项目
  153 + $engineer_id = $assm_id;
  154 + } elseif ($item->type == Project::TYPE_THREE) {
  155 + $engineer_id = Manage::where('name', '杨长远')->value('id') ?? 0; // 建站类项目找杨长远
  156 + } else {
  157 + $engineer_id = collect([
  158 + $item->deploy_build->manager_mid ?? 0,
  159 + $item->deploy_build->leader_mid ?? 0,
  160 + 0
  161 + ])->first(fn($v) => $v !== null && $v !== 0, 0);
  162 + }
  163 + $is_del = (
  164 + $item->extend_type == 5
  165 + || $item->type == 8
  166 + || $item->delete_status == 1
  167 + || $item->site_status == 1
  168 + ) ? 1 : 0;
  169 +
135 $fields = [ 170 $fields = [
136 - 'company_name' => $item->company,  
137 - 'title' => $item->title,  
138 - 'assm_id' => $item->type ==3 ? $item->deploy_optimize->manager_mid ?? 0 : $item->deploy_build->manager_mid ?? 0, // 售后服务经理  
139 - 'seom_id' => $item->deploy_optimize->optimist_mid ?? $item->deploy_optimize->manager_mid ?? $item->deploy_optimize->tech_leader ?? 0, // 优化推广负责人  
140 - 'engineer_id' => $item->type == 3 ?  
141 - $item->deploy_optimize->optimist_mid ?? $item->deploy_optimize->manager_mid ?? $item->deploy_optimize->tech_leader ?? 0  
142 - : $item->deploy_build->manager_mid ?? $item->deploy_build->leader_mid ?? 0, // 技术组长 171 + 'company_name' => $item->company,
  172 + 'title' => $item->title,
  173 + 'assm_id' => $assm_id,
  174 + 'seom_id' => $seom_id,
  175 + 'engineer_id' => $engineer_id,
  176 + 'is_del' => $is_del
143 ]; 177 ];
144 if (!$project) { 178 if (!$project) {
145 $project = new TicketProject(); 179 $project = new TicketProject();
@@ -151,7 +185,7 @@ class FetchTicketProjects extends Command @@ -151,7 +185,7 @@ class FetchTicketProjects extends Command
151 $project->$k = $v; 185 $project->$k = $v;
152 } 186 }
153 $project->save(); 187 $project->save();
154 - }else{ 188 + } else {
155 $changed = false; 189 $changed = false;
156 foreach ($fields as $k => $v) { 190 foreach ($fields as $k => $v) {
157 if ($project->$k != $v) { 191 if ($project->$k != $v) {
@@ -166,7 +200,35 @@ class FetchTicketProjects extends Command @@ -166,7 +200,35 @@ class FetchTicketProjects extends Command
166 $lastid = $item->id; 200 $lastid = $item->id;
167 echo date('Y-m-d H:i:s') . " V6: $item->id {$item->company} fetch ok \n"; 201 echo date('Y-m-d H:i:s') . " V6: $item->id {$item->company} fetch ok \n";
168 } 202 }
169 - }catch (\Exception $exception) { 203 + } catch (\Exception $exception) {
  204 + echo $exception;
  205 + break;
  206 + }
  207 + }
  208 + }
  209 +
  210 + public function fetch_uuid()
  211 + {
  212 + $lastid = 0;
  213 + while (true) {
  214 + try {
  215 + $items = TicketProject::where('id', '>', $lastid)
  216 + ->where('version', 6)
  217 + ->orderBy('id', 'asc')
  218 + ->limit(10)
  219 + ->get();
  220 + if ($items->isEmpty()) {
  221 + echo "not found items \n";
  222 + break;
  223 + }
  224 + foreach ($items as $item) {
  225 + $uuid = md5("V6{$item->table_id}");
  226 + $item->uuid = $uuid;
  227 + $item->save();
  228 + $lastid = $item->id;
  229 + echo date('Y-m-d H:i:s') . " V6: $item->id fetch ok \n";
  230 + }
  231 + } catch (\Exception $exception) {
170 echo $exception; 232 echo $exception;
171 break; 233 break;
172 } 234 }
1 <?php 1 <?php
2 2
3 -namespace App\Console\Commands; 3 +namespace App\Console\Commands\WorkOrder;
4 4
  5 +use App\Models\WorkOrder\TicketLog;
5 use App\Models\WorkOrder\WorkOrderLog; 6 use App\Models\WorkOrder\WorkOrderLog;
6 use App\Services\DingTalkService; 7 use App\Services\DingTalkService;
7 use Illuminate\Console\Command; 8 use Illuminate\Console\Command;
@@ -42,12 +43,12 @@ class WorkOrderDing extends Command @@ -42,12 +43,12 @@ class WorkOrderDing extends Command
42 { 43 {
43 while (true) { 44 while (true) {
44 try { 45 try {
45 - $log = WorkOrderLog::where('ding', 0)->first(); 46 + $log = TicketLog::where('ding', 0)->first();
46 if (!$log) { 47 if (!$log) {
47 sleep(3); 48 sleep(3);
48 continue; 49 continue;
49 } 50 }
50 - $mobile = $log->manager->mobile; 51 + $mobile = $log->engineer->mobile;
51 $response = Http::withBasicAuth( 52 $response = Http::withBasicAuth(
52 env('DINGDING_BASIC_USER'), 53 env('DINGDING_BASIC_USER'),
53 env('DINGDING_BASIC_PASS') 54 env('DINGDING_BASIC_PASS')
@@ -170,12 +170,13 @@ function contains_russian($text) { @@ -170,12 +170,13 @@ function contains_russian($text) {
170 if (!function_exists('curl_c')) { 170 if (!function_exists('curl_c')) {
171 /** 171 /**
172 * @param $url 172 * @param $url
  173 + * @param array $replace
173 * @param $is_array 174 * @param $is_array
174 * @return [] 175 * @return []
175 * @author Akun 176 * @author Akun
176 * @date 2023/11/22 11:33 177 * @date 2023/11/22 11:33
177 */ 178 */
178 - function curl_c($url,$is_array=true){ 179 + function curl_c($url,$is_array=true,$replace=[]){
179 $header = array( 180 $header = array(
180 'Expect:', 181 'Expect:',
181 'Content-Type: application/json; charset=utf-8' 182 'Content-Type: application/json; charset=utf-8'
@@ -197,6 +198,11 @@ if (!function_exists('curl_c')) { @@ -197,6 +198,11 @@ if (!function_exists('curl_c')) {
197 $http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE); 198 $http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
198 curl_close($ch); 199 curl_close($ch);
199 if($http_code == 200){ 200 if($http_code == 200){
  201 + if(!empty($replace)){
  202 + foreach ($replace as $k=>$v){
  203 + $content = str_replace($k,$v,$content);
  204 + }
  205 + }
200 return $is_array ? json_decode($content, true) : $content; 206 return $is_array ? json_decode($content, true) : $content;
201 }else{ 207 }else{
202 return false; 208 return false;
@@ -836,8 +842,18 @@ function ends_with($string, $suffix) @@ -836,8 +842,18 @@ function ends_with($string, $suffix)
836 return substr($string, -strlen($suffix)) === $suffix; 842 return substr($string, -strlen($suffix)) === $suffix;
837 } 843 }
838 844
839 -function getCustomRouteMap($module_route,$route = '') 845 +/**
  846 + * @remark :扩展模块分类路由
  847 + * @name :getCustomRouteMap
  848 + * @author :lyh
  849 + * @method :post
  850 + * @time :2025/6/21 9:57
  851 + */
  852 +function getCustomRouteMap($module_route,$route = '',$is_upgrade = 0)
840 { 853 {
  854 + if($is_upgrade == 0){
  855 + return $route;
  856 + }
841 if($module_route == $route){ 857 if($module_route == $route){
842 $resultRoute = $route; 858 $resultRoute = $route;
843 }else{ 859 }else{
@@ -29,6 +29,7 @@ class TicketController extends BaseController @@ -29,6 +29,7 @@ class TicketController extends BaseController
29 'logs.engineer:id,name', 29 'logs.engineer:id,name',
30 ]) 30 ])
31 ->where('project_id', $project->id) 31 ->where('project_id', $project->id)
  32 + ->where('submit_side', 2)
32 ->orderBy('id', 'desc') 33 ->orderBy('id', 'desc')
33 ->paginate($size, ['*'], 'page', $page); 34 ->paginate($size, ['*'], 'page', $page);
34 return response()->json(['data' => $tickets]); 35 return response()->json(['data' => $tickets]);
@@ -45,13 +46,10 @@ class TicketController extends BaseController @@ -45,13 +46,10 @@ class TicketController extends BaseController
45 { 46 {
46 $request->validated(); 47 $request->validated();
47 $project = TicketProject::where('uuid', $project_id)->first(); 48 $project = TicketProject::where('uuid', $project_id)->first();
48 - if (!$project) return $this->error('未找到项目', 404);  
49 - if ($project->version == 6){  
50 - if ($project->project->projectV6->delete_status) return $this->error('该项目已被删除', 400);  
51 - if ($project->project->projectV6->extend_type == 5) return $this->error('未续费', 400);  
52 - if ($project->project->projectV6->type == 8) return $this->error('项目已归档', 400);  
53 - if ($project->project->projectV6->site_status == 1) return $this->error('站点已关闭', 400);  
54 - } 49 + if (!$project) return response('未找到项目', 404);
  50 + if ($project->is_del) return response('项目状态异常', 400);
  51 + if (empty($project->first_engineer)) return response('项目未分配工单负责人', 400);
  52 +
55 $result = DB::transaction(function () use ($request, $project) { 53 $result = DB::transaction(function () use ($request, $project) {
56 $ticket = new Tickets(); 54 $ticket = new Tickets();
57 $ticket->project_id = $project->id; 55 $ticket->project_id = $project->id;
@@ -68,21 +66,7 @@ class TicketController extends BaseController @@ -68,21 +66,7 @@ class TicketController extends BaseController
68 $ticket->submit_username = $request->input('submit_username'); 66 $ticket->submit_username = $request->input('submit_username');
69 $ticket->save(); 67 $ticket->save();
70 $log = new TicketLog(); 68 $log = new TicketLog();
71 - if ($project->version == 5){  
72 - # V5  
73 - $log->engineer_id = $project->engineer_id;  
74 - }else{  
75 - # V6 的项目  
76 - if ($project->projectV6->type == 3){  
77 - // 项目类型是优化推广,项目负责人找优化  
78 - $seo = $project->projectV6->deploy_optimize;  
79 - $log->engineer_id = $seo->manager_mid ?? $seo->optimist_mid ?? 0;  
80 - }else{  
81 - // 非优化推广项目,项目负责人找技术组长  
82 - $build = $project->projectV6->deploy_build;  
83 - $log->engineer_id = $build->leader_mid ?? 0;  
84 - }  
85 - } 69 + $log->engineer_id = $project->engineer_id; // 默认第一负责人
86 $ticket->logs()->save($log); 70 $ticket->logs()->save($log);
87 return $ticket; 71 return $ticket;
88 }); 72 });
@@ -103,16 +87,12 @@ class TicketController extends BaseController @@ -103,16 +87,12 @@ class TicketController extends BaseController
103 ]) 87 ])
104 ->find($id); 88 ->find($id);
105 89
106 - if (!$ticket) return $this->error('工单未找到', 404); 90 + if (!$ticket) return response('工单未找到', 404);
107 91
108 - if ($ticket->project->uuid !== $project_id) return $this->error('无权限查看该工单', 403); 92 + if ($ticket->project->uuid !== $project_id) return response('无权限查看该工单', 403);
  93 +
  94 + if ($ticket->project->is_del) return response('项目状态异常', 400);
109 95
110 - if ($ticket->project->version == 6){  
111 - if ($ticket->project->projectV6->delete_status) return $this->error('该项目已被删除', 400);  
112 - if ($ticket->project->projectV6->extend_type == 5) return $this->error('未续费', 400);  
113 - if ($ticket->project->projectV6->type == 8) return $this->error('项目已归档', 400);  
114 - if ($ticket->project->projectV6->site_status == 1) return $this->error('站点已关闭', 400);  
115 - }  
116 return response()->json(['data' => $ticket]); 96 return response()->json(['data' => $ticket]);
117 } 97 }
118 98
@@ -148,7 +128,7 @@ class TicketController extends BaseController @@ -148,7 +128,7 @@ class TicketController extends BaseController
148 'first_engineer:id,name', 128 'first_engineer:id,name',
149 ]) 129 ])
150 ->where('uuid', $project_id)->first(); 130 ->where('uuid', $project_id)->first();
151 - if (!$project) return $this->error('未找到项目', 404); 131 + if (!$project) return $this->response('未找到项目', 404);
152 return response()->json(['data' => $project]); 132 return response()->json(['data' => $project]);
153 } 133 }
154 } 134 }
@@ -43,69 +43,6 @@ use Illuminate\Support\Facades\DB; @@ -43,69 +43,6 @@ use Illuminate\Support\Facades\DB;
43 class CNoticeController extends BaseController 43 class CNoticeController extends BaseController
44 { 44 {
45 /** 45 /**
46 - * @remark :计算页面数量  
47 - * @name :countLanguagePage  
48 - * @author :lyh  
49 - * @method :post  
50 - * @time :2025/6/19 17:14  
51 - */  
52 - public function countLanguagePage(){  
53 - $this->request->validate([  
54 - 'language'=>'required',  
55 - 'project_id'=>'required',  
56 - ],[  
57 - 'language.required' => 'language不能为空',  
58 - 'project_id.required' => 'project_id不能为空',  
59 - ]);  
60 - $bigProjectModel = new TranslateBigProject();  
61 - $project_id_arr = $bigProjectModel->selectField(['status'=>1],'project_id') ?? [];  
62 - if(in_array($this->param['project_id'],$project_id_arr)){  
63 - $this->response('success');  
64 - }  
65 - $lang_num = count($this->param['language']);  
66 - ProjectServer::useProject($this->param['project_id']);  
67 - $keyword_num = (new Keyword())->counts(['route'=>['!=',null]]);  
68 - $data_num = $this->productNum() + $this->customNum() + $this->newsNum() + $this->blogNum();  
69 - DB::disconnect('custom_mysql');  
70 - $number = $keyword_num * 18 + $lang_num * $data_num;  
71 - if($number >= 450000){  
72 - $this->response('success',Code::SUCCESS,['msg'=>'翻译数量过多, 大概页面数量:'.$number.', 磁盘空间占用可能会超过40G,请联系管理员操作!']);  
73 - }  
74 - $this->response('success');  
75 - }  
76 -  
77 - /**  
78 - * @remark :产品分类页面数量  
79 - * @name :productCateNum  
80 - * @author :lyh  
81 - * @method :post  
82 - * @time :2025/1/4 10:43  
83 - */  
84 - public function productNum(){  
85 - $number = (new Product())->counts(['status'=>1]);  
86 - $settingModel = new SettingNum();  
87 - $info = $settingModel->read(['type'=>1]);  
88 - if($info === false){  
89 - $product_page_number = 15;  
90 - }else{  
91 - $product_page_number = $info['num'];  
92 - }  
93 - $productCateModel = new Category();  
94 - $productCateList = $productCateModel->list(['status'=>1]);  
95 - if(!empty($productCateList)){  
96 - $cateReModel = new CategoryRelated();  
97 - foreach ($productCateList as $v){  
98 - $cate_num = $cateReModel->counts(['cate_id'=>$v['id']]);  
99 - if($cate_num == 0){  
100 - $number += 1;  
101 - }else{  
102 - $number += ceil($cate_num / $product_page_number);  
103 - }  
104 - }  
105 - }  
106 - return $number;  
107 - }  
108 - /**  
109 * 更新通知C端 46 * 更新通知C端
110 * @param Request $request 47 * @param Request $request
111 * @return \Illuminate\Http\JsonResponse 48 * @return \Illuminate\Http\JsonResponse
@@ -134,102 +71,8 @@ class CNoticeController extends BaseController @@ -134,102 +71,8 @@ class CNoticeController extends BaseController
134 http_post($url, json_encode($param)); 71 http_post($url, json_encode($param));
135 $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!'); 72 $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
136 } 73 }
137 - /**  
138 - * @remark :新闻数量  
139 - * @name :newsNum  
140 - * @author :lyh  
141 - * @method :post  
142 - * @time :2025/1/4 11:21  
143 - */  
144 - public function newsNum(){  
145 - $newsModel = new News();  
146 - $number = $newsModel->counts(['status'=>1]);  
147 - $settingModel = new SettingNum();  
148 - $info = $settingModel->read(['type'=>2]);  
149 - if($info === false){  
150 - $news_page_number = 10;  
151 - }else{  
152 - $news_page_number = $info['num'];  
153 - }  
154 - $newsCateModel = new NewsCategory();  
155 - $newsCateList = $newsCateModel->list(['status'=>0]);  
156 - if(!empty($newsCateList)){  
157 - foreach ($newsCateList as $v){  
158 - $cate_num = $newsModel->counts(['category_id'=>['like',','.$v['id'].',']]);  
159 - if($cate_num == 0){  
160 - $number += 1;  
161 - }else{  
162 - $number += ceil($cate_num / $news_page_number);  
163 - }  
164 - }  
165 - }  
166 - return $number;  
167 - }  
168 -  
169 - /**  
170 - * @remark :博客数量  
171 - * @name :blogNum  
172 - * @author :lyh  
173 - * @method :post  
174 - * @time :2025/1/4 11:21  
175 - */  
176 - public function blogNum(){  
177 - $blogModel = new Blog();  
178 - $number = $blogModel->counts(['status'=>1]);  
179 - $settingModel = new SettingNum();  
180 - $info = $settingModel->read(['type'=>3]);  
181 - if($info === false){  
182 - $news_page_number = 10;  
183 - }else{  
184 - $news_page_number = $info['num'];  
185 - }  
186 - $blogCateModel = new BlogCategory();  
187 - $blogCateList = $blogCateModel->list(['status'=>0]);  
188 - if(!empty($blogCateList)){  
189 - foreach ($blogCateList as $v){  
190 - $cate_num = $blogModel->counts(['category_id'=>['like',','.$v['id'].',']]);  
191 - if($cate_num == 0){  
192 - $number += 1;  
193 - }else{  
194 - $number += ceil($cate_num / $news_page_number);  
195 - }  
196 - }  
197 - }  
198 - return $number;  
199 - }  
200 74
201 /** 75 /**
202 - * @remark :扩展模块数量  
203 - * @name :blogNum  
204 - * @author :lyh  
205 - * @method :post  
206 - * @time :2025/1/4 11:21  
207 - */  
208 - public function customNum(){  
209 - $contentModel = new CustomModuleContent();  
210 - $number = $contentModel->counts(['status'=>0]);  
211 - $settingModel = new SettingNum();  
212 - $info = $settingModel->read(['type'=>2]);  
213 - if($info === false){  
214 - $news_page_number = 10;  
215 - }else{  
216 - $news_page_number = $info['num'];  
217 - }  
218 - $cateModel = new CustomModuleCategory();  
219 - $cateList = $cateModel->list(['status'=>0]);  
220 - if(!empty($cateList)){  
221 - foreach ($cateList as $v){  
222 - $cate_num = $contentModel->counts(['category_id'=>['like',','.$v['id'].',']]);  
223 - if($cate_num == 0){  
224 - $number += 1;  
225 - }else{  
226 - $number += ceil($cate_num / $news_page_number);  
227 - }  
228 - }  
229 - }  
230 - return $number;  
231 - }  
232 - /**  
233 * @remark :获取当前项目选中的语种 76 * @remark :获取当前项目选中的语种
234 * @name :getCountry 77 * @name :getCountry
235 * @author :lyh 78 * @author :lyh
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :ProjectWhiteHatAffixController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/6/23 10:59
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Project;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Models\Project\ProjectWhiteHatAffix;
  15 +use Illuminate\Http\Request;
  16 +
  17 +/**
  18 + * @remark :白帽seo前后缀
  19 + * @name :ProjectWhiteHatAffixController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/6/23 10:59
  23 + */
  24 +class ProjectWhiteHatAffixController extends BaseController
  25 +{
  26 + public function __construct(Request $request)
  27 + {
  28 + $this->model = new ProjectWhiteHatAffix();
  29 + parent::__construct($request);
  30 + }
  31 +
  32 + /**
  33 + * @remark :根据项目获取白帽前后缀
  34 + * @name :lists
  35 + * @author :lyh
  36 + * @method :post
  37 + * @time :2025/6/23 11:00
  38 + * @param :project_id->项目id
  39 + */
  40 + public function list(){
  41 + $this->request->validate([
  42 + 'project_id'=>'required',
  43 + ],[
  44 + 'project_id.required' => '项目id不能为空',
  45 + ]);
  46 + if(isset($this->map['project_id']) && !empty($this->map['project_id'])){
  47 + $this->map['project_id'] = ['in',[0,$this->map['project_id']]];
  48 + }
  49 + $data = $this->model->list($this->map);
  50 + $this->response('success',Code::SUCCESS,$data);
  51 + }
  52 +
  53 + /**
  54 + * @remark :保存数据
  55 + * @name :save
  56 + * @author :lyh
  57 + * @method :post
  58 + * @time :2025/6/23 11:04
  59 + * @param :prefix->前缀
  60 + * @param :suffix->后缀
  61 + * @param :project_id->项目id
  62 + */
  63 + public function save(){
  64 + $this->request->validate([
  65 + 'project_id'=>'required',
  66 + 'name'=>'required',
  67 + 'type'=>'required',
  68 + ],[
  69 + 'project_id.required' => '项目id不能为空',
  70 + 'name.required' => '前后缀名称不能为空',
  71 + 'type.required' => '类型不能为空',
  72 + ]);
  73 + if(isset($this->param['id']) && !empty($this->param['id'])){
  74 + $id = $this->param['id'];
  75 + $this->model->edit($this->param,['id'=>$this->param['id']]);
  76 + }else{
  77 + $id = $this->model->addReturnId($this->param);
  78 + }
  79 + $this->response('success',Code::SUCCESS,['id'=>$id]);
  80 + }
  81 +
  82 + /**
  83 + * @remark :删除数据
  84 + * @name :del
  85 + * @author :lyh
  86 + * @method :post
  87 + * @time :2025/6/23 11:08
  88 + * @param :ids->id集合数组
  89 + */
  90 + public function del(){
  91 + $this->request->validate([
  92 + 'ids'=>'required',
  93 + ],[
  94 + 'ids.required' => '项目id不能为空',
  95 + ]);
  96 + foreach ($this->param['ids'] as $id){
  97 + $info = $this->model->read(['id'=>$id]);
  98 + if($info['project_id'] == 0){
  99 + continue;
  100 + }
  101 + $this->model->del(['id'=>$id]);
  102 + }
  103 + $this->response('success');
  104 + }
  105 +}
@@ -25,9 +25,9 @@ class AsideTicketController extends BaseController @@ -25,9 +25,9 @@ class AsideTicketController extends BaseController
25 * 1. 超管看所有工单 25 * 1. 超管看所有工单
26 * 2. 其他查看和自己有关的工单 26 * 2. 其他查看和自己有关的工单
27 */ 27 */
28 - $lists = TicketLog::with([  
29 - 'ticket.project.projectV6:id,company,title',  
30 - 'ticket.logs.engineer:id,name', 28 + $lists = Tickets::with([
  29 + 'logs.engineer:id,name',
  30 + 'project',
31 ]) 31 ])
32 ->when($this, function ($query) { 32 ->when($this, function ($query) {
33 $role = $this->manage['role']; 33 $role = $this->manage['role'];
@@ -36,31 +36,34 @@ class AsideTicketController extends BaseController @@ -36,31 +36,34 @@ class AsideTicketController extends BaseController
36 return $query; 36 return $query;
37 } 37 }
38 // 其他角色查自己参与的工单 38 // 其他角色查自己参与的工单
39 - return $query->where('engineer_id', $this->manage['id']); 39 + return $query->where(function ($q) {
  40 + $q->where('submit_user_id', $this->manage['id'])
  41 + ->orWhereHas('logs', function ($q1) {
  42 + $q1->where('engineer_id', $this->manage['id']);
  43 + });
  44 + });
40 }) 45 })
41 ->when($request->input('project_id') !== null, function ($query) use ($request) { 46 ->when($request->input('project_id') !== null, function ($query) use ($request) {
42 // project_id 查 gl_ticket_projects.uuid 47 // project_id 查 gl_ticket_projects.uuid
43 - return $query->whereHas('ticket.project', function ($q) use ($request) {  
44 - $q->where('uuid', $request->input('project_id')); 48 + $projectId = $request->input('project_id');
  49 + return $query->whereHas('project', function ($q) use ($projectId) {
  50 + $q->where('uuid', $projectId);
45 }); 51 });
46 }) 52 })
47 ->when($request->input('status') !== null, function ($query) use ($request) { 53 ->when($request->input('status') !== null, function ($query) use ($request) {
48 // status 查 gl_tickets.status 54 // status 查 gl_tickets.status
49 - return $query->whereHas('ticket', function ($q) use ($request) {  
50 - $q->where('status', $request->input('status'));  
51 - }); 55 + $status = $request->input('status');
  56 + return $query->where('status', $status);
52 }) 57 })
53 ->when($request->input('search'), function ($query) use ($request) { 58 ->when($request->input('search'), function ($query) use ($request) {
54 // search 查 gl_tickets.title 或 gl_ticket_projects.title 或 gl_ticket_projects.company_name 59 // search 查 gl_tickets.title 或 gl_ticket_projects.title 或 gl_ticket_projects.company_name
55 $search = $request->input('search'); 60 $search = $request->input('search');
56 - $query->where(function ($q) use ($search) {  
57 - $q->whereHas('ticket', function ($q1) use ($search) {  
58 - $q1->where('title', 'like', '%' . $search . '%');  
59 - })  
60 - ->orWhereHas('ticket.project', function ($q2) use ($search) {  
61 - $q2->where('title', 'like', '%' . $search . '%')  
62 - ->orWhere('company_name', 'like', '%' . $search . '%');  
63 - }); 61 + return $query->where(function ($q) use ($search) {
  62 + $q->where('title', 'like', '%' . $search . '%')
  63 + ->orWhereHas('project', function ($q1) use ($search) {
  64 + $q1->where('title', 'like', '%' . $search . '%')
  65 + ->orWhere('company_name', 'like', '%' . $search . '%');
  66 + });
64 }); 67 });
65 }) 68 })
66 ->orderBy('id', 'desc') 69 ->orderBy('id', 'desc')
@@ -70,16 +73,11 @@ class AsideTicketController extends BaseController @@ -70,16 +73,11 @@ class AsideTicketController extends BaseController
70 73
71 public function getProjects($search) 74 public function getProjects($search)
72 { 75 {
73 - $projects = TicketProject::with([  
74 - 'projectV6:id,company,title',  
75 - ]) 76 + $projects = TicketProject::where('is_del', 0)
76 ->where(function ($query) use ($search) { 77 ->where(function ($query) use ($search) {
  78 + // 查找项目名称或公司名称
77 $query->where('title', 'like', '%' . $search . '%') 79 $query->where('title', 'like', '%' . $search . '%')
78 - ->orWhere('company_name', 'like', '%' . $search . '%')  
79 - ->orWhereHas('projectV6', function ($q) use ($search) {  
80 - $q->where('company', 'like', '%' . $search . '%')  
81 - ->orWhere('title', 'like', '%' . $search . '%');  
82 - }); 80 + ->orWhere('company_name', 'like', '%' . $search . '%');
83 }) 81 })
84 ->get(); 82 ->get();
85 $this->response('success', Code::SUCCESS, $projects); 83 $this->response('success', Code::SUCCESS, $projects);
@@ -95,12 +93,7 @@ class AsideTicketController extends BaseController @@ -95,12 +93,7 @@ class AsideTicketController extends BaseController
95 { 93 {
96 $request->validated(); 94 $request->validated();
97 $project = TicketProject::where('uuid', $request->input('project_id'))->first(); 95 $project = TicketProject::where('uuid', $request->input('project_id'))->first();
98 - if ($project->version == 6){  
99 - if ($project->projectV6->delete_status) $this->response('该项目已被删除', Code::USER_MODEL_NOTFOUND_ERROE);  
100 - if ($project->projectV6->extend_type == 5) $this->response('未续费', Code::USER_MODEL_NOTFOUND_ERROE);  
101 - if ($project->projectV6->type == 8) $this->response('项目已归档', Code::USER_MODEL_NOTFOUND_ERROE);  
102 - if ($project->projectV6->site_status == 1) $this->response('站点已关闭', Code::USER_MODEL_NOTFOUND_ERROE);  
103 - } 96 + if ($project->is_del) $this->response('该项目状态异常', Code::USER_MODEL_NOTFOUND_ERROE);
104 $result = DB::transaction(function () use ($request, $project) { 97 $result = DB::transaction(function () use ($request, $project) {
105 $ticket = new Tickets(); 98 $ticket = new Tickets();
106 $ticket->project_id = $project->id; 99 $ticket->project_id = $project->id;
@@ -193,7 +186,6 @@ class AsideTicketController extends BaseController @@ -193,7 +186,6 @@ class AsideTicketController extends BaseController
193 186
194 $ticket->reply = $request->input('reply', null); 187 $ticket->reply = $request->input('reply', null);
195 $ticket->status = $request->input('status', $ticket->status); 188 $ticket->status = $request->input('status', $ticket->status);
196 - $ticket->save();  
197 if ($ticket->status == Tickets::STATUS_COMPLETED) 189 if ($ticket->status == Tickets::STATUS_COMPLETED)
198 { 190 {
199 // 完成工单,把子任务里面未完成的工单改为完成 191 // 完成工单,把子任务里面未完成的工单改为完成
@@ -201,6 +193,7 @@ class AsideTicketController extends BaseController @@ -201,6 +193,7 @@ class AsideTicketController extends BaseController
201 $ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED) 193 $ticket->logs()->where('status', '<', TicketLog::STATUS_COMPLETED)
202 ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]); 194 ->update(['status' => TicketLog::STATUS_COMPLETED, 'end_at' => now()]);
203 } 195 }
  196 + $ticket->save();
204 return $ticket; 197 return $ticket;
205 }); 198 });
206 $this->response('success', Code::SUCCESS, $result->toArray()); 199 $this->response('success', Code::SUCCESS, $result->toArray());
@@ -69,10 +69,11 @@ class AsideTicketLogController extends BaseController @@ -69,10 +69,11 @@ class AsideTicketLogController extends BaseController
69 if ($log->status >= TicketLog::STATUS_COMPLETED) 69 if ($log->status >= TicketLog::STATUS_COMPLETED)
70 { 70 {
71 // 我的工单标记为已完成 71 // 我的工单标记为已完成
72 - $log->status = $request->input('status');  
73 $log->end_at = now(); 72 $log->end_at = now();
74 } 73 }
75 } 74 }
  75 + if ($request->input('reply') !== null)
  76 + $log->reply = $request->input('reply', '');
76 $log->save(); 77 $log->save();
77 // 是否有未完成的子任务 78 // 是否有未完成的子任务
78 $pending = $ticket->logs() 79 $pending = $ticket->logs()
@@ -42,7 +42,7 @@ class CustomModuleCategoryController extends BaseController @@ -42,7 +42,7 @@ class CustomModuleCategoryController extends BaseController
42 $template_id = $this->getModuleTemplateId($this->param['module_id']); 42 $template_id = $this->getModuleTemplateId($this->param['module_id']);
43 foreach ($list as $k => $v){ 43 foreach ($list as $k => $v){
44 $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM); 44 $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM);
45 - $v['url'] = $this->user['domain'].getCustomRouteMap($moduleInfo['route'],$v['route']); 45 + $v['url'] = $this->user['domain'].getCustomRouteMap($moduleInfo['route'],$v['route'],$this->user['is_upgrade']);
46 $list[$k] = $v; 46 $list[$k] = $v;
47 } 47 }
48 } 48 }
@@ -184,6 +184,9 @@ class FileManageController extends BaseController @@ -184,6 +184,9 @@ class FileManageController extends BaseController
184 $enName = $fileName .'-'.$i; 184 $enName = $fileName .'-'.$i;
185 $i++; 185 $i++;
186 } 186 }
  187 + if(empty($enName)){
  188 + $enName = md5(uniqid().$name);
  189 + }
187 return $enName.'.'.$suffix; 190 return $enName.'.'.$suffix;
188 } 191 }
189 192
@@ -43,6 +43,7 @@ class TestController extends BaseController @@ -43,6 +43,7 @@ class TestController extends BaseController
43 * @time :2025/2/13 16:34 43 * @time :2025/2/13 16:34
44 */ 44 */
45 public function ceshi(){ 45 public function ceshi(){
46 - $this->response('success',Code::SUCCESS,[]); 46 + $data = Translate::tran('测试翻译', 'en');
  47 + $this->response('success',Code::SUCCESS,['data'=>$data]);
47 } 48 }
48 } 49 }
@@ -26,6 +26,7 @@ use App\Models\Inquiry\InquiryIP; @@ -26,6 +26,7 @@ use App\Models\Inquiry\InquiryIP;
26 use App\Models\Inquiry\InquirySet; 26 use App\Models\Inquiry\InquirySet;
27 use App\Models\Manage\Manage; 27 use App\Models\Manage\Manage;
28 use App\Models\Project\After; 28 use App\Models\Project\After;
  29 +use App\Models\Project\AggregateKeywordComment;
29 use App\Models\Project\AiBlogTask; 30 use App\Models\Project\AiBlogTask;
30 use App\Models\Project\DeployBuild; 31 use App\Models\Project\DeployBuild;
31 use App\Models\Project\DeployOptimize; 32 use App\Models\Project\DeployOptimize;
@@ -427,6 +428,12 @@ class ProjectLogic extends BaseLogic @@ -427,6 +428,12 @@ class ProjectLogic extends BaseLogic
427 $this->param['deploy_build']['is_supplier'] = 1; 428 $this->param['deploy_build']['is_supplier'] = 1;
428 } 429 }
429 } 430 }
  431 + //聚合页评论为空时,生成评论
  432 + $keywordCommentModel = new AggregateKeywordComment();
  433 + $commentNum = $keywordCommentModel->counts(['project_id'=>$param['id']]);
  434 + if(empty($commentNum)){
  435 + NoticeLog::createLog(NoticeLog::TYPE_INIT_KEYWORD_COMMON, ['project_id' => $param['id']]);
  436 + }
430 } 437 }
431 if($param['type'] == Project::TYPE_FIVE){ 438 if($param['type'] == Project::TYPE_FIVE){
432 $param['extend_type'] = Project::TYPE_FIVE; 439 $param['extend_type'] = Project::TYPE_FIVE;
@@ -202,7 +202,7 @@ class BlogCategoryLogic extends BaseLogic @@ -202,7 +202,7 @@ class BlogCategoryLogic extends BaseLogic
202 RouteMap::delRoute(RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); 202 RouteMap::delRoute(RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']);
203 //生成一条删除路由记录 203 //生成一条删除路由记录
204 $info = $this->model->read(['id'=>$id],['id','alias']); 204 $info = $this->model->read(['id'=>$id],['id','alias']);
205 - $this->curlDelRoute(['old_route'=>$info['alias']]); 205 + $this->curlDelRoute(['old_route'=>$info['alias'],'source'=>RouteMap::SOURCE_BLOG_CATE]);
206 return $this->success(); 206 return $this->success();
207 } 207 }
208 208
@@ -161,7 +161,7 @@ class BlogLogic extends BaseLogic @@ -161,7 +161,7 @@ class BlogLogic extends BaseLogic
161 public function delRoute($id){ 161 public function delRoute($id){
162 //生成一条删除路由记录 162 //生成一条删除路由记录
163 $info = $this->model->read(['id'=>$id],['id','url']); 163 $info = $this->model->read(['id'=>$id],['id','url']);
164 - $this->curlDelRoute(['old_route'=>$info['url']]); 164 + $this->curlDelRoute(['old_route'=>$info['url'],'source'=>RouteMap::SOURCE_BLOG]);
165 return $this->success(); 165 return $this->success();
166 } 166 }
167 167
@@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\CustomModule; @@ -11,6 +11,7 @@ namespace App\Http\Logic\Bside\CustomModule;
11 11
12 use App\Http\Logic\Bside\BaseLogic; 12 use App\Http\Logic\Bside\BaseLogic;
13 use App\Models\Com\NoticeLog; 13 use App\Models\Com\NoticeLog;
  14 +use App\Models\CustomModule\CustomModule;
14 use App\Models\CustomModule\CustomModuleCategory; 15 use App\Models\CustomModule\CustomModuleCategory;
15 use App\Models\RouteMap\RouteMap; 16 use App\Models\RouteMap\RouteMap;
16 use App\Models\Template\BTemplate; 17 use App\Models\Template\BTemplate;
@@ -221,7 +222,10 @@ class CustomModuleCategoryLogic extends BaseLogic @@ -221,7 +222,10 @@ class CustomModuleCategoryLogic extends BaseLogic
221 } 222 }
222 RouteMap::delRoute(RouteMap::SOURCE_MODULE_CATE, $id, $this->user['project_id']); 223 RouteMap::delRoute(RouteMap::SOURCE_MODULE_CATE, $id, $this->user['project_id']);
223 //通知 224 //通知
224 - $this->curlDelRoute(['old_route'=>$info['route']]); 225 + //获取模块路由
  226 + $customModuleModel = new CustomModule();
  227 + $moduleInfo = $customModuleModel->read(['id'=>$info['module_id']]);
  228 + $this->curlDelRoute(['old_route'=>$info['route'],'path'=>getCustomRouteMap($moduleInfo['route'],$info['route'],$this->user['is_upgrade'])]);
225 return $this->success(); 229 return $this->success();
226 } 230 }
227 231
@@ -355,8 +355,13 @@ class CustomModuleContentLogic extends BaseLogic @@ -355,8 +355,13 @@ class CustomModuleContentLogic extends BaseLogic
355 { 355 {
356 RouteMap::delRoute(RouteMap::SOURCE_MODULE, $id, $this->user['project_id']); 356 RouteMap::delRoute(RouteMap::SOURCE_MODULE, $id, $this->user['project_id']);
357 //通知 357 //通知
358 - $info = $this->model->read(['id' => $id], ['id', 'route']);  
359 - $this->curlDelRoute(['old_route'=>$info['route']]); 358 + $info = $this->model->read(['id' => $id], ['id', 'route','category_id']);
  359 + $categoryIdArr = $info['category_id'];
  360 + $cate_id = (int)array_shift($categoryIdArr);
  361 + $routeMapModel = new RouteMap();
  362 + $routeInfo = $routeMapModel->read(['source'=>RouteMap::SOURCE_MODULE_CATE,'source_id'=>$cate_id]);
  363 + $path = ($routeInfo['route'] ?? '');
  364 + $this->curlDelRoute(['old_route'=>$info['route'],'path'=>$path]);
360 return $this->success(); 365 return $this->success();
361 } 366 }
362 367
@@ -216,7 +216,7 @@ class NewsCategoryLogic extends BaseLogic @@ -216,7 +216,7 @@ class NewsCategoryLogic extends BaseLogic
216 //删除路由映射 216 //删除路由映射
217 RouteMap::delRoute(RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); 217 RouteMap::delRoute(RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
218 $info = $this->model->read(['id'=>$id],['id','alias']); 218 $info = $this->model->read(['id'=>$id],['id','alias']);
219 - $this->curlDelRoute(['old_route'=>$info['alias']]); 219 + $this->curlDelRoute(['old_route'=>$info['alias'],'source'=>RouteMap::SOURCE_NEWS_CATE]);
220 return $this->success(); 220 return $this->success();
221 } 221 }
222 222
@@ -357,7 +357,7 @@ class NewsLogic extends BaseLogic @@ -357,7 +357,7 @@ class NewsLogic extends BaseLogic
357 { 357 {
358 //生成一条删除路由记录 358 //生成一条删除路由记录
359 $info = $this->model->read(['id' => $id], ['id', 'url']); 359 $info = $this->model->read(['id' => $id], ['id', 'url']);
360 - $this->curlDelRoute(['old_route'=>$info['url']]); 360 + $this->curlDelRoute(['old_route'=>$info['url'],'source'=>RouteMap::SOURCE_NEWS]);
361 return $this->success(); 361 return $this->success();
362 } 362 }
363 363
@@ -199,7 +199,7 @@ class CategoryLogic extends BaseLogic @@ -199,7 +199,7 @@ class CategoryLogic extends BaseLogic
199 //生成一条删除路由记录 199 //生成一条删除路由记录
200 $info = $this->model->read(['id'=>$id],['id','route']); 200 $info = $this->model->read(['id'=>$id],['id','route']);
201 if($info !== false){ 201 if($info !== false){
202 - $this->curlDelRoute(['old_route'=>$info['route']]); 202 + $this->curlDelRoute(['old_route'=>$info['route'],'source'=>RouteMap::SOURCE_PRODUCT_CATE]);
203 } 203 }
204 return $this->success(); 204 return $this->success();
205 } 205 }
@@ -188,7 +188,7 @@ class KeywordLogic extends BaseLogic @@ -188,7 +188,7 @@ class KeywordLogic extends BaseLogic
188 //生成一条删除路由记录 188 //生成一条删除路由记录
189 $info = $this->model->read(['id'=>$id],['id','route']); 189 $info = $this->model->read(['id'=>$id],['id','route']);
190 if($info !== false){ 190 if($info !== false){
191 - $this->curlDelRoute(['old_route'=>$info['route']]); 191 + $this->curlDelRoute(['old_route'=>$info['route'],'source'=>RouteMap::SOURCE_PRODUCT_KEYWORD]);
192 } 192 }
193 return $this->success(); 193 return $this->success();
194 } 194 }
@@ -396,7 +396,6 @@ class KeywordLogic extends BaseLogic @@ -396,7 +396,6 @@ class KeywordLogic extends BaseLogic
396 preg_match_all('/\{[^{}]*\}/', $text, $matches); 396 preg_match_all('/\{[^{}]*\}/', $text, $matches);
397 $data = []; 397 $data = [];
398 $twoMonthsAgo = strtotime('-2 months'); 398 $twoMonthsAgo = strtotime('-2 months');
399 -  
400 if (!empty($text)) { 399 if (!empty($text)) {
401 foreach ($matches[0] as $item) { 400 foreach ($matches[0] as $item) {
402 $item = str_replace("'", '"', $item); 401 $item = str_replace("'", '"', $item);
@@ -472,7 +472,7 @@ class ProductLogic extends BaseLogic @@ -472,7 +472,7 @@ class ProductLogic extends BaseLogic
472 public function delRoute($id){ 472 public function delRoute($id){
473 //生成一条删除路由记录 473 //生成一条删除路由记录
474 $info = $this->model->read(['id'=>$id],['id','route']); 474 $info = $this->model->read(['id'=>$id],['id','route']);
475 - $this->curlDelRoute(['old_route'=>$info['route']]); 475 + $this->curlDelRoute(['old_route'=>$info['route'],'source'=>RouteMap::SOURCE_PRODUCT]);
476 return $this->success(); 476 return $this->success();
477 } 477 }
478 478
@@ -306,6 +306,7 @@ class UserLoginLogic @@ -306,6 +306,7 @@ class UserLoginLogic
306 $info['is_inquiry_country'] = $project['is_inquiry_country']; 306 $info['is_inquiry_country'] = $project['is_inquiry_country'];
307 $info['is_subscribe'] = $project['is_subscribe']; 307 $info['is_subscribe'] = $project['is_subscribe'];
308 $info['is_news'] = $project['is_news'] ?? 0; 308 $info['is_news'] = $project['is_news'] ?? 0;
  309 + $info['api_no'] = $project['deploy_optimize']['api_no'] ?? '';
309 //是否开通AMP 310 //是否开通AMP
310 $is_amp = 0; 311 $is_amp = 0;
311 if(!empty($project['deploy_optimize']['domain'])){ 312 if(!empty($project['deploy_optimize']['domain'])){
  1 +<?php
  2 +
  3 +namespace App\Models\Product;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class StockData extends Model
  8 +{
  9 + protected $connection = "custom_mysql";
  10 +
  11 + protected $table = 'gl_stock_data';
  12 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :ProjectWhiteHatAffix.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/6/23 11:01
  8 + */
  9 +
  10 +namespace App\Models\Project;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +/**
  15 + * @remark :白帽seo的前后缀
  16 + * @name :ProjectWhiteHatAffix
  17 + * @author :lyh
  18 + * @method :post
  19 + * @time :2025/6/23 11:02
  20 + */
  21 +class ProjectWhiteHatAffix extends Base
  22 +{
  23 + protected $table = 'gl_project_white_hat_affix';
  24 +}
@@ -15,7 +15,6 @@ Route::middleware(['aloginauth'])->group(function () { @@ -15,7 +15,6 @@ Route::middleware(['aloginauth'])->group(function () {
15 Route::any('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); 15 Route::any('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white');
16 Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 16 Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址
17 Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify'); 17 Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify');
18 - Route::any('/countLanguagePage', [Aside\Com\CNoticeController::class, 'countLanguagePage'])->name('admin.countLanguagePage');//统计页面数量  
19 Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry'); 18 Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry');
20 Route::any('/getDynamicPassword', [Aside\Com\IndexController::class, 'getDynamicPassword'])->name('admin.getDynamicPassword'); 19 Route::any('/getDynamicPassword', [Aside\Com\IndexController::class, 'getDynamicPassword'])->name('admin.getDynamicPassword');
21 Route::any('/notAiHumanizer', [Aside\Com\IndexController::class, 'notAiHumanizer'])->name('admin.notAiHumanizer'); 20 Route::any('/notAiHumanizer', [Aside\Com\IndexController::class, 'notAiHumanizer'])->name('admin.notAiHumanizer');
@@ -596,6 +595,12 @@ Route::middleware(['aloginauth'])->group(function () { @@ -596,6 +595,12 @@ Route::middleware(['aloginauth'])->group(function () {
596 }); 595 });
597 }); 596 });
598 597
  598 + //白帽seo前后缀
  599 + Route::prefix('white_hat')->group(function () {
  600 + Route::any('/list', [Aside\Project\ProjectWhiteHatAffixController::class, 'list'])->name('admin.white_hat_read');
  601 + Route::any('/save', [Aside\Project\ProjectWhiteHatAffixController::class, 'save'])->name('admin.white_hat_save');
  602 + Route::any('/del', [Aside\Project\ProjectWhiteHatAffixController::class, 'del'])->name('admin.white_hat_del');
  603 + });
599 }); 604 });
600 605
601 //无需登录验证的路由组 606 //无需登录验证的路由组
@@ -621,6 +626,8 @@ Route::group([], function () { @@ -621,6 +626,8 @@ Route::group([], function () {
621 Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect'); 626 Route::any('/collect', [Aside\Collect\CollectController::class, 'index'])->name('admin.collect');
622 //同步询盘 627 //同步询盘
623 Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry'); 628 Route::any('/sync_inquiry', [Aside\Com\IndexController::class, 'sync_inquiry'])->name('admin.sync_inquiry');
  629 + Route::post('/images_uploads', [\App\Http\Controllers\File\ImageController::class, 'upload'])->name('admin.images_uploads');//无需登录上传
  630 + Route::post('/files_uploads', [\App\Http\Controllers\File\FileController::class, 'upload'])->name('admin.files_uploads');
624 }); 631 });
625 632
626 633