作者 zhl

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

@@ -9,9 +9,14 @@ @@ -9,9 +9,14 @@
9 9
10 namespace App\Console\Commands\Ai; 10 namespace App\Console\Commands\Ai;
11 11
  12 +use App\Helper\Arr;
  13 +use App\Models\Com\Notify;
  14 +use App\Models\Devops\ServerConfig;
  15 +use App\Models\Devops\ServersIp;
12 use App\Models\Domain\DomainInfo; 16 use App\Models\Domain\DomainInfo;
13 use App\Models\Project\AiBlogTask as AiBlogTaskModel; 17 use App\Models\Project\AiBlogTask as AiBlogTaskModel;
14 use App\Models\Ai\AiBlogAuthor as AiBlogAuthorModel; 18 use App\Models\Ai\AiBlogAuthor as AiBlogAuthorModel;
  19 +use App\Models\Project\Project;
15 use App\Services\AiBlogService; 20 use App\Services\AiBlogService;
16 use App\Services\ProjectServer; 21 use App\Services\ProjectServer;
17 use Illuminate\Console\Command; 22 use Illuminate\Console\Command;
@@ -105,18 +110,53 @@ class AiBlogAuthorId extends Command @@ -105,18 +110,53 @@ class AiBlogAuthorId extends Command
105 * @time :2025/5/26 16:21 110 * @time :2025/5/26 16:21
106 */ 111 */
107 public function sendCPost($project_id){ 112 public function sendCPost($project_id){
108 - $domainModel = new DomainInfo();  
109 - $domain = $domainModel->getProjectIdDomain($project_id);  
110 - $c_url = $domain.'api/update_page/';  
111 - $param = [  
112 - 'project_id' => $project_id,  
113 - 'type' => 1,  
114 - 'route' => 3,  
115 - 'url' => $this->route,  
116 - 'language'=> [],  
117 - 'is_sitemap' => 0  
118 - ];  
119 - $res = http_post($c_url, json_encode($param,true));  
120 - echo 'notify: project id: ' . $project_id . ', result: ' . json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); 113 + //获取项目所在服务器
  114 + $project_model = new Project();
  115 + $project_info = $project_model->read(['id'=>$project_id],['serve_id','is_upgrade', 'main_lang_id']);
  116 + if(!$project_info){
  117 + return false;
  118 + }
  119 + $serve_ip_model = new ServersIp();
  120 + $serve_ip_info = $serve_ip_model->read(['id'=>$project_info['serve_id']],['servers_id']);
  121 + $servers_id = $serve_ip_info ? $serve_ip_info['servers_id'] : 0;
  122 + if($servers_id == ServerConfig::SELF_SITE_ID){
  123 + //自建站服务器:如果项目已经上线,不请求C端接口,数据直接入库
  124 + $domain_model = new DomainInfo();
  125 + $domain_info = $domain_model->read(['project_id'=>$this->user['project_id']],['domain']);
  126 + if($domain_info){
  127 + //判断是否已有更新进行中
  128 + $notify_model = new Notify();
  129 + $data = [
  130 + 'project_id' => $project_id,
  131 + 'type' => 1,
  132 + 'route' => 3,
  133 + 'server_id' => ServerConfig::SELF_SITE_ID,
  134 + 'status' => ['!=',Notify::STATUS_FINISH_SITEMAP]
  135 + ];
  136 + $notify = $notify_model->read($data,['id']);
  137 + if(!$notify){
  138 + $domain = $domain_info['domain'];
  139 + $data['data'] = Arr::a2s(['domain'=>$domain,'url'=>$this->route,'language'=>[]]);
  140 + $data['status'] = Notify::STATUS_INIT;
  141 + $data['is_pull_html_zip'] = Notify::IS_PULL_HTML_ZIP_FALSE;
  142 + $data['sort'] = 1;
  143 + $notify_model->add($data);
  144 + }
  145 + }
  146 + }else{
  147 + $domainModel = new DomainInfo();
  148 + $domain = $domainModel->getProjectIdDomain($project_id);
  149 + $c_url = $domain.'api/update_page/';
  150 + $param = [
  151 + 'project_id' => $project_id,
  152 + 'type' => 1,
  153 + 'route' => 3,
  154 + 'url' => $this->route,
  155 + 'language'=> [],
  156 + 'is_sitemap' => 0
  157 + ];
  158 + $res = http_post($c_url, json_encode($param,true));
  159 + echo 'notify: project id: ' . $project_id . ', result: ' . json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
  160 + }
121 } 161 }
122 } 162 }
@@ -100,13 +100,13 @@ class DomainInfo extends Command @@ -100,13 +100,13 @@ class DomainInfo extends Command
100 $v->domain_start_time = $valid_time['start']; 100 $v->domain_start_time = $valid_time['start'];
101 $v->domain_end_time = $valid_time['end']; 101 $v->domain_end_time = $valid_time['end'];
102 $v->save(); 102 $v->save();
103 - }  
104 - }  
105 103
106 - //域名到期提醒  
107 - if ($v->domain_end_time && $v->domain_end_time < $end_day) {  
108 - $is_end = $v->domain_end_time < date('Y-m-d H:i:s') ? 1 : 0;  
109 - $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end); 104 + //域名到期提醒
  105 + if ($valid_time['end'] < $end_day) {
  106 + $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
  107 + $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
  108 + }
  109 + }
110 } 110 }
111 } else { 111 } else {
112 //除自建站项目外,记录已解析到别的ip的域名 112 //除自建站项目外,记录已解析到别的ip的域名
@@ -141,13 +141,13 @@ class DomainInfo extends Command @@ -141,13 +141,13 @@ class DomainInfo extends Command
141 $v->domain_start_time = $valid_time['start']; 141 $v->domain_start_time = $valid_time['start'];
142 $v->domain_end_time = $valid_time['end']; 142 $v->domain_end_time = $valid_time['end'];
143 $v->save(); 143 $v->save();
144 - }  
145 - }  
146 144
147 - //域名到期提醒  
148 - if ($v->domain_end_time && $v->domain_end_time < $end_day) {  
149 - $is_end = $v->domain_end_time < date('Y-m-d H:i:s') ? 1 : 0;  
150 - $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end); 145 + //域名到期提醒
  146 + if ($valid_time['end'] < $end_day) {
  147 + $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
  148 + $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
  149 + }
  150 + }
151 } 151 }
152 152
153 if ($v['amp_status'] == 1) { 153 if ($v['amp_status'] == 1) {
@@ -412,8 +412,9 @@ class DomainInfo extends Command @@ -412,8 +412,9 @@ class DomainInfo extends Command
412 ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT) 412 ->where('binding_app', ProjectAssociation::ENTERPRISE_WECHAT)
413 ->value('friend_id'); 413 ->value('friend_id');
414 if ($friend_id) { 414 if ($friend_id) {
415 - $tips = $is_end ? ' 已经到期' : ' 即将到期';  
416 - $message = '【域名到期提醒】' . PHP_EOL . '域名 ' . $domain . $tips . ',请及时处理。'; 415 + $top_domain = getTopDomain($domain);
  416 + $tips = $is_end ? ' 已经到期,请及时处理。' : ' 有效期不足一个月,请留意。';
  417 + $message = '【域名到期提醒】' . PHP_EOL . '域名 ' . $top_domain . $tips;
417 $param = [ 418 $param = [
418 'project_id' => $project_id, 419 'project_id' => $project_id,
419 'friend_id' => $friend_id, 420 'friend_id' => $friend_id,
@@ -35,7 +35,7 @@ class RemainDay extends Command @@ -35,7 +35,7 @@ class RemainDay extends Command
35 * 按照达标天数收费的项目(白帽) 35 * 按照达标天数收费的项目(白帽)
36 */ 36 */
37 protected $bm_projectId = [ 37 protected $bm_projectId = [
38 - 4247,4299,4310,4215,4038,4084,4148,4178 38 + 4247,4299,4310,4215,4038,4084,4148,4178,4405
39 ]; 39 ];
40 40
41 41
@@ -120,7 +120,7 @@ class RemainDay extends Command @@ -120,7 +120,7 @@ class RemainDay extends Command
120 //白帽版本的系统 120 //白帽版本的系统
121 if($deploy_build['seo_plan'] == 1){ 121 if($deploy_build['seo_plan'] == 1){
122 if($deploy_build['seo_service_duration'] != 0){ 122 if($deploy_build['seo_service_duration'] != 0){
123 - if(in_array($item['id'],$this->bm_projectId) || (strpos($item['level'], '19') !== false)){ 123 + if(in_array($item['id'],$this->bm_projectId) || (in_array( 19,$item['level']))){
124 $compliance_day = (int)$item['bm_finish_remain_day']; 124 $compliance_day = (int)$item['bm_finish_remain_day'];
125 $seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day']; 125 $seo_remain_day = $deploy_build['seo_service_duration'] - (int)$item['bm_finish_remain_day'];
126 }else{ 126 }else{
@@ -165,6 +165,7 @@ class GeoQuestionRes extends Command @@ -165,6 +165,7 @@ class GeoQuestionRes extends Command
165 'keywords_num'=>$keyword_num ?? [], 165 'keywords_num'=>$keyword_num ?? [],
166 'url_num'=>$url_num ?? [], 166 'url_num'=>$url_num ?? [],
167 'is_match'=>$is_match ?? 0, 167 'is_match'=>$is_match ?? 0,
  168 + 'label'=>$taskInfo['label'] ?? null,
168 'created_at'=>date('Y-m-d H:i:s'), 169 'created_at'=>date('Y-m-d H:i:s'),
169 'updated_at'=>date('Y-m-d H:i:s'), 170 'updated_at'=>date('Y-m-d H:i:s'),
170 ]; 171 ];
@@ -50,7 +50,7 @@ class lyhDemo extends Command @@ -50,7 +50,7 @@ class lyhDemo extends Command
50 protected $description = '更新路由'; 50 protected $description = '更新路由';
51 51
52 public function handle(){ 52 public function handle(){
53 - return $this->getExpectResult(); 53 + return $this->_actionRoute();
54 return true; 54 return true;
55 } 55 }
56 56
@@ -74,25 +74,22 @@ class lyhDemo extends Command @@ -74,25 +74,22 @@ class lyhDemo extends Command
74 * @time :2025/7/22 15:14 74 * @time :2025/7/22 15:14
75 */ 75 */
76 public function _actionRoute(){ 76 public function _actionRoute(){
77 - $geo_service = new GeoService();  
78 - $data = $geo_service->getDeepSeekResult("创贸总共多少人?",'gpt-4o-mini'); 77 + $projectModel = new Project();
  78 + $lists = $projectModel->list(['delete_status' => 0,'is_ai_blog'=>1,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
  79 + $data = [];
  80 + foreach ($lists as $item){
  81 + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
  82 + ProjectServer::useProject($item['id']);
  83 + $aiBlogModel = new AiBlog();
  84 + $info = $aiBlogModel->read(['text'=>['like','%href="blog/%']],['id']);
  85 + if($info !== false){
  86 + echo '需要处理->项目id:'.$item['id'].PHP_EOL;
  87 + $data[] = $item['id'];
  88 + }
  89 + echo 'end';
  90 + DB::disconnect('custom_mysql');
  91 + }
79 dd($data); 92 dd($data);
80 -// $projectModel = new Project();  
81 -// $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']);  
82 -// $data = [];  
83 -// foreach ($lists as $item){  
84 -// echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;  
85 -// ProjectServer::useProject($item['id']);  
86 -// $aiBlogModel = new AiBlog();  
87 -// $info = $aiBlogModel->read(['route'=>null],['id']);  
88 -// if($info !== false){  
89 -// echo '项目id:'.$item['id'].PHP_EOL;  
90 -// $data[] = $item['id'];  
91 -// }  
92 -// dd($data);  
93 -// echo 'end';  
94 -// DB::disconnect('custom_mysql');  
95 -// }  
96 } 93 }
97 94
98 public function _actionTemplateMain(){ 95 public function _actionTemplateMain(){
@@ -76,7 +76,7 @@ class TicketCount extends Command @@ -76,7 +76,7 @@ class TicketCount extends Command
76 $date = Carbon::yesterday()->toDateString(); // 昨日时间 76 $date = Carbon::yesterday()->toDateString(); // 昨日时间
77 $ticketManageCountModel = new TicketDailyManageCount(); 77 $ticketManageCountModel = new TicketDailyManageCount();
78 foreach ($manageList as $item){ 78 foreach ($manageList as $item){
79 - $average_time = ''; 79 + $average_time = null;
80 $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']); 80 $this->output('按人员统计:执行的人员名称/id:'.$item['name'].'/'.$item['manage_id']);
81 $ticketLogModel = new TicketLog(); 81 $ticketLogModel = new TicketLog();
82 $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]); 82 $ticket_num = $ticketLogModel->counts(['engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
@@ -88,6 +88,9 @@ class TicketCount extends Command @@ -88,6 +88,9 @@ class TicketCount extends Command
88 } 88 }
89 //最快完成的时间 89 //最快完成的时间
90 $fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time'); 90 $fastest_time = $ticketLogModel->formatQuery(['engineer_id'=>$item['manage_id'],'is_engineer'=>1,'end_at'=>['!=',null]])->min('end_time');
  91 + if(!$fastest_time){
  92 + $fastest_time = null;
  93 + }
91 //超时工单数量 94 //超时工单数量
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')]]); 95 $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]); 96 $complete_num = $ticketLogModel->counts(['end_at'=>['!=',null],'engineer_id'=>$item['manage_id'],'is_engineer'=>1]);
@@ -96,8 +99,8 @@ class TicketCount extends Command @@ -96,8 +99,8 @@ class TicketCount extends Command
96 'manage_id'=>$item['id'], 99 'manage_id'=>$item['id'],
97 'manage_name'=>$item['name'], 100 'manage_name'=>$item['name'],
98 'ticket_num'=>$ticket_num,//工单总数量 101 'ticket_num'=>$ticket_num,//工单总数量
99 - 'average_time'=>$average_time ?? '',//平均完成工单时长  
100 - 'fastest_time'=>$fastest_time,//最快完成工单时间 102 + 'average_time'=>$average_time ?? null,//平均完成工单时长
  103 + 'fastest_time'=>$fastest_time ?? null,//最快完成工单时间
101 'timeout_num'=>$timeout_num,//超时工单数量 104 'timeout_num'=>$timeout_num,//超时工单数量
102 'complete_num'=>$complete_num,//完成工单数量 105 'complete_num'=>$complete_num,//完成工单数量
103 'dept_id'=>$item['dept_id'] 106 'dept_id'=>$item['dept_id']
@@ -130,7 +133,7 @@ class TicketCount extends Command @@ -130,7 +133,7 @@ class TicketCount extends Command
130 $ticketDailyDeptModel = new TicketDailyDeptCount(); 133 $ticketDailyDeptModel = new TicketDailyDeptCount();
131 $date = Carbon::yesterday()->toDateString(); // "2025-08-07" 134 $date = Carbon::yesterday()->toDateString(); // "2025-08-07"
132 foreach ($groupList as $item){ 135 foreach ($groupList as $item){
133 - $average_time = ''; 136 + $average_time = null;
134 $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']); 137 $this->output('组统计:执行的组/id:'.$item['name'].'/'.$item['id']);
135 $manageIdArr = $manageHrModel->selectField(['belong_group'=>$item['id'],'status'=>1,'dept_id'=>1],'manage_id'); 138 $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]); 139 $ticket_num = $ticketLogModel->counts(['engineer_id'=>['in',$manageIdArr],'is_engineer'=>1]);
@@ -143,7 +146,7 @@ class TicketCount extends Command @@ -143,7 +146,7 @@ class TicketCount extends Command
143 'dept_id'=>$item['id'], 146 'dept_id'=>$item['id'],
144 'dept_name'=>$item['name'], 147 'dept_name'=>$item['name'],
145 'ticket_num'=>$ticket_num ?? 0, 148 'ticket_num'=>$ticket_num ?? 0,
146 - 'average_time'=>$average_time ?? '' 149 + 'average_time'=>$average_time ?? null
147 ]; 150 ];
148 $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']); 151 $deptInfo = $ticketDailyDeptModel->read(['date'=>$date,'dept_id'=>$item['id']],['id']);
149 if($deptInfo === false){ 152 if($deptInfo === false){
@@ -189,7 +192,7 @@ class TicketCount extends Command @@ -189,7 +192,7 @@ class TicketCount extends Command
189 'add_num'=>$add_num, 192 'add_num'=>$add_num,
190 'untreated_num'=>$untreated_num, 193 'untreated_num'=>$untreated_num,
191 'processed_num'=>$processed_num, 194 'processed_num'=>$processed_num,
192 - 'average_time'=>$average_time ?? '', 195 + 'average_time'=>$average_time ?? null,
193 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true), 196 'source'=>json_encode(['a'=>$submit_a_side,'b'=>$submit_b_side],true),
194 'source_type'=>json_encode($dbResult,true) 197 'source_type'=>json_encode($dbResult,true)
195 ]; 198 ];
@@ -435,6 +435,7 @@ class WebTraffic extends Command @@ -435,6 +435,7 @@ class WebTraffic extends Command
435 } 435 }
436 })->inRandomOrder()->first(); 436 })->inRandomOrder()->first();
437 if(!$ipdata){ 437 if(!$ipdata){
  438 + $data[] = [];
438 continue; 439 continue;
439 } 440 }
440 $ipdata = (array)$ipdata ?: []; 441 $ipdata = (array)$ipdata ?: [];
@@ -480,6 +480,7 @@ class WebTrafficRussia extends Command @@ -480,6 +480,7 @@ class WebTrafficRussia extends Command
480 $ip_area = $this->get_rand($project_country); 480 $ip_area = $this->get_rand($project_country);
481 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); 481 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first();
482 if(!$res){ 482 if(!$res){
  483 + $data[] = [];
483 continue; 484 continue;
484 } 485 }
485 $res = (array)$res ?: []; 486 $res = (array)$res ?: [];
@@ -471,6 +471,7 @@ class WebTrafficRussiaSpecial extends Command @@ -471,6 +471,7 @@ class WebTrafficRussiaSpecial extends Command
471 $ip_area = $this->get_rand($project_country); 471 $ip_area = $this->get_rand($project_country);
472 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first(); 472 $res = DB::table('gl_xunpan_ipdata')->where('ip_area', $ip_area)->inRandomOrder()->first();
473 if(!$res){ 473 if(!$res){
  474 + $data[] = [];
474 continue; 475 continue;
475 } 476 }
476 $res = (array)$res ?: []; 477 $res = (array)$res ?: [];
@@ -421,6 +421,7 @@ class WebTrafficSpecial extends Command @@ -421,6 +421,7 @@ class WebTrafficSpecial extends Command
421 } 421 }
422 })->inRandomOrder()->first(); 422 })->inRandomOrder()->first();
423 if(!$ipdata){ 423 if(!$ipdata){
  424 + $data[] = [];
424 continue; 425 continue;
425 } 426 }
426 $ipdata = (array)$ipdata ?: []; 427 $ipdata = (array)$ipdata ?: [];
@@ -216,11 +216,11 @@ class FetchTicketProjects extends Command @@ -216,11 +216,11 @@ class FetchTicketProjects extends Command
216 216
217 // 第一负责人 217 // 第一负责人
218 /** 218 /**
219 - * 5.0升级6.0的项目,白帽SEO的项目 都划给售后 219 + * 5.0升级6.0的项目,白帽SEO, GEO的项目 都划给售后
220 * 其他:建站中找项目经理,建站完成找杨长远,推广找售后服务经理 220 * 其他:建站中找项目经理,建站完成找杨长远,推广找售后服务经理
221 */ 221 */
222 - if ($item->is_upgrade || $item->project_type == 1)  
223 - $engineer_id = $assm_id; // V5升V6,白帽SEO,找售后服务经理 222 + if ($item->is_upgrade || $item->project_type == 1 || $item->deploy_build->seo_plan > 0)
  223 + $engineer_id = $assm_id; // V5升V6,白帽SEO,GEO,找售后服务经理
224 elseif ($status == 1) 224 elseif ($status == 1)
225 $engineer_id = $pm_id; // 建站中找项目经理 225 $engineer_id = $pm_id; // 建站中找项目经理
226 elseif ($status == 2) 226 elseif ($status == 2)
@@ -62,6 +62,7 @@ class ServersController extends BaseController @@ -62,6 +62,7 @@ class ServersController extends BaseController
62 unset($this->map['project_name']); 62 unset($this->map['project_name']);
63 } 63 }
64 if(isset($this->map['domain']) && !empty($this->map['domain'])){ 64 if(isset($this->map['domain']) && !empty($this->map['domain'])){
  65 + $this->map['domain'] = parse_url($this->map['domain'], PHP_URL_HOST); // 直接取域名部分
65 $domainModel = new DomainInfo(); 66 $domainModel = new DomainInfo();
66 $domainInfo = $domainModel->read(['domain'=>['like','%'.$this->map['domain'].'%']],['id','project_id']); 67 $domainInfo = $domainModel->read(['domain'=>['like','%'.$this->map['domain'].'%']],['id','project_id']);
67 if($domainInfo !== false && !empty($domainInfo['project_id'])){ 68 if($domainInfo !== false && !empty($domainInfo['project_id'])){
@@ -74,6 +75,8 @@ class ServersController extends BaseController @@ -74,6 +75,8 @@ class ServersController extends BaseController
74 $this->map['id'] = $ipInfo['servers_id']; 75 $this->map['id'] = $ipInfo['servers_id'];
75 } 76 }
76 } 77 }
  78 + }else{
  79 + $this->map['id'] = 0;
77 } 80 }
78 unset($this->map['domain']); 81 unset($this->map['domain']);
79 } 82 }
@@ -102,11 +102,11 @@ class GeoQuestionController extends BaseController @@ -102,11 +102,11 @@ class GeoQuestionController extends BaseController
102 'type'=>'required', 102 'type'=>'required',
103 ],[ 103 ],[
104 'project_id.required' => '项目ID不能为空', 104 'project_id.required' => '项目ID不能为空',
105 - 'question.required' => '项目ID不能为空',  
106 - 'keywords.required' => '项目ID不能为空',  
107 - 'url.required' => '项目ID不能为空',  
108 - 'status.required' => '项目ID不能为空',  
109 - 'type.required' => '类型不能为空', 105 + 'question.required' => 'question不能为空',
  106 + 'keywords.required' => 'keywords不能为空',
  107 + 'url.required' => 'url不能为空',
  108 + 'status.required' => 'status不能为空',
  109 + 'type.required' => 'type类型不能为空',
110 ]); 110 ]);
111 $data = $this->logic->saveGeoQuestion(); 111 $data = $this->logic->saveGeoQuestion();
112 $this->response('success',Code::SUCCESS,$data); 112 $this->response('success',Code::SUCCESS,$data);
@@ -49,7 +49,6 @@ class TicketController extends BaseController @@ -49,7 +49,6 @@ class TicketController extends BaseController
49 ],[ 49 ],[
50 'dept_id.required' => '技术组id', 50 'dept_id.required' => '技术组id',
51 ]); 51 ]);
52 - $this->order = 'ticket_num';  
53 $sort = $this->map['sort'] ?? 'desc'; 52 $sort = $this->map['sort'] ?? 'desc';
54 $data = $this->logic->getManageTicketCount($this->map,$this->order,$sort); 53 $data = $this->logic->getManageTicketCount($this->map,$this->order,$sort);
55 $this->response('success',Code::SUCCESS,$data); 54 $this->response('success',Code::SUCCESS,$data);
@@ -48,11 +48,14 @@ class GeoQuestionResLogic extends BaseLogic @@ -48,11 +48,14 @@ class GeoQuestionResLogic extends BaseLogic
48 */ 48 */
49 public function getResultList($map = [],$page = 1,$row = 20){ 49 public function getResultList($map = [],$page = 1,$row = 20){
50 $map['project_id'] = $this->user['project_id']; 50 $map['project_id'] = $this->user['project_id'];
51 - $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','created_at','updated_at']; 51 + $filed = ['id','project_id','question_id','platform','is_match','question','en_question','keywords','url','label','created_at','updated_at'];
52 if(!empty($map['created_at'])){ 52 if(!empty($map['created_at'])){
53 $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']]; 53 $map['created_at'] = ['between',[$map['created_at'].' 00:00:00',$map['created_at'].' 23:59:59']];
54 $this->model = new GeoQuestionLog(); 54 $this->model = new GeoQuestionLog();
55 } 55 }
  56 + if(isset($map['label']) && !empty($map['label'])){
  57 + $map['label'] = ['like','%'.$map['label'].'%'];
  58 + }
56 if(!empty($map['keywords'])){ 59 if(!empty($map['keywords'])){
57 $map['keywords'] = ['like','%'.$map['keywords'].'%']; 60 $map['keywords'] = ['like','%'.$map['keywords'].'%'];
58 } 61 }
@@ -345,6 +345,11 @@ class ProductLogic extends BaseLogic @@ -345,6 +345,11 @@ class ProductLogic extends BaseLogic
345 }else{ 345 }else{
346 $param['category_id'] = ''; 346 $param['category_id'] = '';
347 } 347 }
  348 + if(isset($param['og_image']) && !empty($param['og_image'])){
  349 + $param['og_image'] = str_replace_url($param['og_image'] ?? '');
  350 + }else{
  351 + $param['og_image'] = $param['gallery'][0]['url'] ?? '';
  352 + }
348 //产品图 353 //产品图
349 if(isset($param['gallery']) && !empty($param['gallery'])){ 354 if(isset($param['gallery']) && !empty($param['gallery'])){
350 foreach ($param['gallery'] as $k => $v){ 355 foreach ($param['gallery'] as $k => $v){
@@ -357,11 +362,6 @@ class ProductLogic extends BaseLogic @@ -357,11 +362,6 @@ class ProductLogic extends BaseLogic
357 $param['thumb'] = Arr::a2s([]); 362 $param['thumb'] = Arr::a2s([]);
358 $param['gallery'] = Arr::a2s([]); 363 $param['gallery'] = Arr::a2s([]);
359 } 364 }
360 - if(isset($param['og_image']) && !empty($param['og_image'])){  
361 - $param['og_image'] = str_replace_url($param['og_image'] ?? '');  
362 - }else{  
363 - $param['og_image'] = $param['thumb']['url'] ?? '';  
364 - }  
365 if(isset($param['files'])){ 365 if(isset($param['files'])){
366 $param['files']['url'] = str_replace_url($param['files']['url'] ?? ''); 366 $param['files']['url'] = str_replace_url($param['files']['url'] ?? '');
367 $param['files'] = Arr::a2s($param['files'] ?? []); 367 $param['files'] = Arr::a2s($param['files'] ?? []);