作者 赵彬吉
@@ -36,6 +36,7 @@ class RemainDay extends Command @@ -36,6 +36,7 @@ class RemainDay extends Command
36 */ 36 */
37 protected $ceaseProjectId = [ 37 protected $ceaseProjectId = [
38 354, 38 354,
  39 + 378,
39 649, 40 649,
40 1283, 41 1283,
41 2066 42 2066
@@ -88,9 +88,9 @@ class SyncProject extends Command @@ -88,9 +88,9 @@ class SyncProject extends Command
88 if($data['data']['order_type'] == '首次'){ 88 if($data['data']['order_type'] == '首次'){
89 $this->sync($data['data'],$is_update); 89 $this->sync($data['data'],$is_update);
90 //同步aicc 90 //同步aicc
91 - if($data['data']['exclusive_aicc']){  
92 - $this->toAicc($data['data']);  
93 - } 91 +// if($data['data']['exclusive_aicc']){
  92 +// $this->toAicc($data['data']);
  93 +// }
94 //同步hagro 94 //同步hagro
95 if($data['data']['exclusive_hagro']){ 95 if($data['data']['exclusive_hagro']){
96 $this->toHagro($data['data']); 96 $this->toHagro($data['data']);
@@ -16,9 +16,11 @@ use App\Models\Com\KeywordVideoTask; @@ -16,9 +16,11 @@ use App\Models\Com\KeywordVideoTask;
16 use App\Models\Com\KeywordVideoTaskLog; 16 use App\Models\Com\KeywordVideoTaskLog;
17 use App\Models\CustomModule\CustomModuleCategory; 17 use App\Models\CustomModule\CustomModuleCategory;
18 use App\Models\CustomModule\CustomModuleContent; 18 use App\Models\CustomModule\CustomModuleContent;
  19 +use App\Models\CustomModule\CustomModuleExtentContent;
19 use App\Models\Devops\ServerConfig; 20 use App\Models\Devops\ServerConfig;
20 use App\Models\Devops\Servers; 21 use App\Models\Devops\Servers;
21 use App\Models\Devops\ServersIp; 22 use App\Models\Devops\ServersIp;
  23 +use App\Models\ExtentModule\ExtensionModuleValue;
22 use App\Models\File\File; 24 use App\Models\File\File;
23 use App\Models\File\File as FileModel; 25 use App\Models\File\File as FileModel;
24 use App\Models\File\Image; 26 use App\Models\File\Image;
@@ -62,14 +64,12 @@ class Demo extends Command @@ -62,14 +64,12 @@ class Demo extends Command
62 protected $description = 'demo'; 64 protected $description = 'demo';
63 65
64 public function handle(){ 66 public function handle(){
65 - $keywordVideoModel = new KeywordVideoTask();  
66 - $list = $keywordVideoModel->list();  
67 - foreach ($list as $v){  
68 - echo date('Y-m-d H:i:s') . 'project_id:'.$v['project_id'] . PHP_EOL;  
69 - ProjectServer::useProject($v['project_id']);  
70 - $this->getProduct(); 67 +
  68 + echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
  69 + ProjectServer::useProject(2837);
  70 + $this->ceshi();
71 DB::disconnect('custom_mysql'); 71 DB::disconnect('custom_mysql');
72 - } 72 +
73 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 73 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
74 } 74 }
75 75
@@ -192,7 +192,7 @@ if (!function_exists('curl_c')) { @@ -192,7 +192,7 @@ if (!function_exists('curl_c')) {
192 if($http_code == 200){ 192 if($http_code == 200){
193 return $is_array ? json_decode($content, true) : $content; 193 return $is_array ? json_decode($content, true) : $content;
194 }else{ 194 }else{
195 - return $http_code; 195 + return false;
196 } 196 }
197 } 197 }
198 } 198 }
@@ -88,7 +88,7 @@ class BaseController extends Controller @@ -88,7 +88,7 @@ class BaseController extends Controller
88 break; 88 break;
89 case "end_at": 89 case "end_at":
90 $this->_btw[1] = $v; 90 $this->_btw[1] = $v;
91 - $this->map['updated_at'] = ['between', $this->_btw]; 91 + $this->map['created_at'] = ['between', $this->_btw];
92 break; 92 break;
93 default: 93 default:
94 if ($v != null) { 94 if ($v != null) {
@@ -32,6 +32,7 @@ class ManagerLogController extends BaseController @@ -32,6 +32,7 @@ class ManagerLogController extends BaseController
32 if(isset($this->map['name']) && !empty($this->map['name'])){ 32 if(isset($this->map['name']) && !empty($this->map['name'])){
33 $ids = $managerModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray(); 33 $ids = $managerModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray();
34 $this->map['manage_id'] = ['in',$ids]; 34 $this->map['manage_id'] = ['in',$ids];
  35 + unset($this->map['name']);
35 } 36 }
36 if(isset($this->map['url']) && !empty($this->map['url'])){ 37 if(isset($this->map['url']) && !empty($this->map['url'])){
37 $this->map['url'] = ['like','%'.$this->map['url'].'%']; 38 $this->map['url'] = ['like','%'.$this->map['url'].'%'];
@@ -61,6 +62,7 @@ class ManagerLogController extends BaseController @@ -61,6 +62,7 @@ class ManagerLogController extends BaseController
61 if(isset($this->map['name']) && !empty($this->map['name'])){ 62 if(isset($this->map['name']) && !empty($this->map['name'])){
62 $ids = $userModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray(); 63 $ids = $userModel->where('name', 'like', '%' . $this->param['name'] . '%')->pluck('id')->toArray();
63 $this->map['operator_id'] = ['in',$ids]; 64 $this->map['operator_id'] = ['in',$ids];
  65 + unset($this->map['name']);
64 } 66 }
65 if(isset($this->map['model']) && !empty($this->map['model'])){ 67 if(isset($this->map['model']) && !empty($this->map['model'])){
66 $this->map['model'] = ['like','%'.$this->map['model'].'%']; 68 $this->map['model'] = ['like','%'.$this->map['model'].'%'];
@@ -41,7 +41,9 @@ class OperationHeartbeatController extends BaseController @@ -41,7 +41,9 @@ class OperationHeartbeatController extends BaseController
41 'is_custom.required' => '是否为扩展模版', 41 'is_custom.required' => '是否为扩展模版',
42 'is_template.required' => '详情页/可视化', 42 'is_template.required' => '详情页/可视化',
43 ]); 43 ]);
44 - 44 + if(empty($this->param['source_id'])){
  45 + $this->response('success');
  46 + }
45 $condition = ['project_id'=>$this->user['project_id'],'source'=>$this->param['source'],'source_id'=>$this->param['source_id'], 47 $condition = ['project_id'=>$this->user['project_id'],'source'=>$this->param['source'],'source_id'=>$this->param['source_id'],
46 'is_list'=>$this->param['is_list'],'is_custom'=>$this->param['is_custom'],'is_template'=>$this->param['is_template']]; 48 'is_list'=>$this->param['is_list'],'is_custom'=>$this->param['is_custom'],'is_template'=>$this->param['is_template']];
47 $operationHeartbeatModel = new OperationHeartbeat(); 49 $operationHeartbeatModel = new OperationHeartbeat();
@@ -279,4 +279,16 @@ class KeywordController extends BaseController @@ -279,4 +279,16 @@ class KeywordController extends BaseController
279 $logic->delRelated($this->param['keyword_id'],$this->param['product_id']); 279 $logic->delRelated($this->param['keyword_id'],$this->param['product_id']);
280 $this->response('success'); 280 $this->response('success');
281 } 281 }
  282 +
  283 + /**
  284 + * @remark :清除当前项目所有关键字
  285 + * @name :delAllKeyword
  286 + * @author :lyh
  287 + * @method :post
  288 + * @time :2024/12/5 16:34
  289 + */
  290 + public function delAllKeyword(KeywordLogic $logic){
  291 + $logic->delAllKeyword();
  292 + $this->response('success');
  293 + }
282 } 294 }
@@ -12,8 +12,11 @@ namespace App\Http\Controllers\Bside; @@ -12,8 +12,11 @@ namespace App\Http\Controllers\Bside;
12 use App\Enums\Common\Code; 12 use App\Enums\Common\Code;
13 use App\Http\Logic\Bside\News\NewsLogic; 13 use App\Http\Logic\Bside\News\NewsLogic;
14 use App\Models\Channel\Channel; 14 use App\Models\Channel\Channel;
  15 +use App\Models\CustomModule\CustomModuleCategory;
15 use App\Models\CustomModule\CustomModuleContent; 16 use App\Models\CustomModule\CustomModuleContent;
  17 +use App\Models\CustomModule\CustomModuleExtentContent;
16 use App\Models\Domain\DomainInfo; 18 use App\Models\Domain\DomainInfo;
  19 +use App\Models\ExtentModule\ExtensionModuleValue;
17 use App\Models\Manage\ManageHr; 20 use App\Models\Manage\ManageHr;
18 use App\Models\Project\CountAllProject as AllProject; 21 use App\Models\Project\CountAllProject as AllProject;
19 use App\Models\Project\Project; 22 use App\Models\Project\Project;
@@ -31,139 +34,175 @@ class TestController extends BaseController @@ -31,139 +34,175 @@ class TestController extends BaseController
31 * @time :2024/11/11 14:51 34 * @time :2024/11/11 14:51
32 */ 35 */
33 public function ceshi(){ 36 public function ceshi(){
34 - $data = $this->NoSixProject();  
35 - $this->response('success',Code::SUCCESS,$data);  
36 - }  
37 -  
38 - public function NoSixProject(){  
39 - $res_data = [];  
40 -// $i = 1;  
41 -// while (true){  
42 - $url = 'https://quanqiusou.cn/extend_api/api/projects.php?page=1&pagesize=1';  
43 - $result = http_get($url);  
44 - $data = $result['data'];  
45 -// if(empty($data)){  
46 -// break;  
47 -// }  
48 -// $res_data = array_merge($res_data,$data['data']);  
49 -// $i++;  
50 -// }  
51 - return $data;  
52 - }  
53 -  
54 - public function SixProject(){  
55 - $projectModel = new Project();  
56 - $query = $projectModel->leftJoin('gl_project_payment', 'gl_project.id', '=', 'gl_project_payment.project_id')  
57 - ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')  
58 - ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')  
59 - ->where('gl_project.delete_status',Project::TYPE_ZERO);  
60 - $lists = $query->paginate(100000, $this->selectParam(), 'page', 1)->toArray();  
61 - $manageModel = new ManageHr();  
62 - foreach ($lists as $k => $v){  
63 - $allProjectModel = new AllProject();  
64 - $info = $allProjectModel->read(['version'=>1,'project_id'=>$v['id']],['id']);  
65 - if($info === false){  
66 - $channel = Channel::getChannelText($v['channel']['user_id'] ?? 0);  
67 - $data[] = [  
68 - 'project_id'=>$v['id'],  
69 - 'version'=>1,//代表6.0  
70 - 'is_upgrade'=>$v['is_upgrade'],  
71 - 'title'=>$v['title'],  
72 - 'company'=>$v['company'],  
73 - 'channel'=>$channel,  
74 - 'sale'=>$this->end_channel($channel),  
75 - 'join_date'=>$v['cooperate_date'],  
76 - 'online_date'=>$v['uptime'],  
77 - 'keywords_num'=>$v['key'],  
78 - 'service_num'=>$v['day'],  
79 - 'production_num'=>intval(abs(strtotime((empty($v['uptime']) ? date('Y-m-d H:i:s') : $v['uptime'])) - $v['created_at']) / 86400),  
80 - 'plan'=>Project::planMap()[$v['plan']],  
81 - 'status'=>$v['status'],  
82 - 'test_domain'=>$v['test_domain'],  
83 - 'product_domain'=>!empty($v['domain']) ? (new DomainInfo())->getDomain($v['domain']) : '',  
84 - 'project_manager'=>$manageModel->getName($v['manager_mid'] ?? ''),  
85 - 'project_group'=>$manageModel->getName($v['leader_mid'] ?? ''),  
86 - 'project_design'=>$manageModel->getName($v['designer_mid'] ?? ''),  
87 - 'project_assistant'=>$manageModel->getName($v['tech_mid'] ?? ''),  
88 - 'service_manager'=>$manageModel->getName($v['optimize_manager_mid'] ??''),  
89 - 'service_optimize'=>$manageModel->getName($v['optimize_optimist_mid'] ??''),  
90 - 'service_assistant'=>$manageModel->getName($v['optimize_assist_mid'] ??''),  
91 - 'qa'=>$manageModel->getName($v['quality_mid'] ??''),  
92 - ];  
93 - $allProjectModel->add($data);  
94 - }else{  
95 - $data_edit = [  
96 - 'title'=>$v['title'],  
97 - 'company'=>$v['company'],  
98 - 'channel'=>Channel::getChannelText($v['channel']['user_id'] ?? 0),  
99 - 'sale'=>$this->end_channel($channel),  
100 - 'join_date'=>$v['cooperate_date'],  
101 - 'online_date'=>$v['uptime'],  
102 - 'keywords_num'=>$v['key'],  
103 - 'service_num'=>$v['day'],  
104 - 'production_num'=>intval(abs(strtotime((empty($v['uptime']) ? date('Y-m-d H:i:s') : $v['uptime'])) - $v['created_at']) / 86400),  
105 - 'plan'=>Project::planMap()[$v['plan']],  
106 - 'status'=>$v['status'],  
107 - 'test_domain'=>$v['test_domain'],  
108 - 'product_domain'=>!empty($v['domain']) ? (new DomainInfo())->getDomain($v['domain']) : '',  
109 - 'project_manager'=>$manageModel->getName($v['manager_mid'] ?? ''),  
110 - 'project_group'=>$manageModel->getName($v['leader_mid'] ?? ''),  
111 - 'project_design'=>$manageModel->getName($v['designer_mid'] ?? ''),  
112 - 'project_assistant'=>$manageModel->getName($v['tech_mid'] ?? ''),  
113 - 'service_manager'=>$manageModel->getName($v['optimize_manager_mid'] ??''),  
114 - 'service_optimize'=>$manageModel->getName($v['optimize_optimist_mid'] ??''),  
115 - 'service_assistant'=>$manageModel->getName($v['optimize_assist_mid'] ??''),  
116 - 'qa'=>$manageModel->getName($v['quality_mid'] ??''),  
117 - ];  
118 - $allProjectModel->edit($data_edit,['id'=>$info['id']]);  
119 - }  
120 -  
121 - } 37 + $this->response('success',Code::SUCCESS,[]);
122 } 38 }
123 39
124 /** 40 /**
125 - * 需要查询的字段  
126 - * @return array 41 + * @remark :导入扩展模块 (保留)
  42 + * @name :ceshis
  43 + * @author :lyh
  44 + * @method :post
  45 + * @time :2024/12/6 17:02
127 */ 46 */
128 - public function selectParam(){  
129 - $select = [  
130 - 'gl_project.id AS id',  
131 - 'gl_project.title AS title',  
132 - 'gl_project.channel AS channel',  
133 - 'gl_project.company AS company',  
134 - 'gl_project.type AS type',  
135 - 'gl_project.extend_type AS extend_type',  
136 - 'gl_project.uptime AS uptime',  
137 - 'gl_project.is_upgrade AS is_upgrade',  
138 - 'gl_project.created_at AS created_at',  
139 - 'gl_project.cooperate_date AS cooperate_date',  
140 - 'gl_project.site_status AS site_status',  
141 - 'gl_project_deploy_build.keyword_num AS key',  
142 - 'gl_project_deploy_build.service_duration AS day',  
143 - 'gl_project_deploy_build.is_comment AS is_comment',  
144 - 'gl_project_deploy_build.leader_mid AS leader_mid',  
145 - 'gl_project_deploy_build.manager_mid AS manager_mid',  
146 - 'gl_project_deploy_build.designer_mid AS designer_mid',  
147 - 'gl_project_deploy_build.tech_mid AS tech_mid',  
148 - 'gl_project_deploy_build.test_domain AS test_domain',  
149 - 'gl_project_deploy_build.plan AS plan',  
150 - 'gl_project_deploy_optimize.dept_id AS optimize_dept_id',  
151 - 'gl_project_deploy_optimize.manager_mid AS optimize_manager_mid',  
152 - 'gl_project_deploy_optimize.optimist_mid AS optimize_optimist_mid',  
153 - 'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid',  
154 - 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid',  
155 - 'gl_project_deploy_optimize.tech_leader AS tech_leader',  
156 - 'gl_project_deploy_optimize.domain AS domain',  
157 - 'gl_project_deploy_optimize.api_no AS api_no', 47 + public function ceshis(){
  48 + $data = 'MBR10100CT,Schottky Barrier Rectifier,TO-220AB,100,5*2,common cathode,100,0.85,10,2500,175,-,Active
  49 +MBR2060BCT,Schottky Barrier Rectifier,ITO-220AB,60,10*2,common cathode,150,0.75,50,5000,150,-,Active
  50 +MBR20150DCT,Schottky Barrier Rectifier,TO-263(D2PAK),150,10*2,common cathode,150,0.88,5,1500,175,-,Active
  51 +MUR2060CT,High Efficient Rectifier,TO-220AB,600,10*2,common cathode,150,1.7,1,500,150,50,Active
  52 +MUR2040FCT,High Efficient Rectifier,ITO-220AB,400,10*2,common cathode,150,1.3,1,500,150,50,Active
  53 +DSEK20S04B,Ultra fast soft Recovery Rectifier,TO-252(DPAK),400,10*2,common cathode,125,1.25,2,500,175,35,Active
  54 +DSEK30S06D,Ultra fast soft Recovery Rectifier,TO-263(D2PAK),600,15*2,common cathode,150,1.7,2,500,175,35,Active
  55 +DSEK60H06P,Ultra fast soft Recovery Rectifier,TO-247AD,600,30*2,common cathode,300,1.7,5,500,175,60,Active
  56 +GBU410,Bridge Rectifier,GBU,1000,4,-,125,1,1,500,150,-,Active
  57 +GBU1510,Bridge Rectifier,GBU,1000,15,-,250,1,1,500,150,-,Active
  58 +GBJ2510,Bridge Rectifier,GBJ,1000,25,-,300,1,1,500,150,-,Active
  59 +GBU1504H,High Efficient Bridge Rectifier,GBU,400,15,-,150,1.3,1,500,150,-,Active
  60 +GBU1506H,High Efficient Bridge Rectifier,GBU,400,15,-,150,1.7,1,500,150,-,Active
  61 +GBJ2504H,High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.3,1,500,150,-,Active
  62 +GBJ2506H,High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.7,1,500,150,-,Active
  63 +1N4007,Standard Recovery Rectifier,DO-41,1000,1,-,50,1,1,500,150,-,Active
  64 +1N5399,Standard Recovery Rectifier,DO-15,1000,1.5,-,75,1,1,500,150,-,Active
  65 +1N5408,Standard Recovery Rectifier,DO-27,1000,3,-,100,1,1,500,150,-,Active
  66 +RS1M,Fast Recovery Rectifier,SMA,1000,1,-,50,1.3,1,500,150,500,Active
  67 +RS2M,Fast Recovery Rectifier,SMB,1000,2,-,75,1.3,1,500,150,500,Active
  68 +RS3M,Fast Recovery Rectifier,SMC,1000,3,-,100,1.3,1,500,150,500,Active
  69 +SF28,Super fast Recovery Rectifier,DO-15,600,2,-,60,1.7,1,500,150,35,Active
  70 +SF56G,Super fast Recovery Rectifier,DO-27,400,5,-,125,1.3,1,500,150,35,Active
  71 +DSE1006,Super fast Recovery Rectifier,TO-220AC,600,10,Single Positive,150,1.7,1,500,150,35,Active
  72 +DSE1504F,Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4,1,500,150,35,Active';
  73 + $array = explode("\n", $data);
  74 + foreach ($array as $values){
  75 + $array1 = explode(',',$values);
  76 + $contentData = [
  77 + 'name'=>$array1[0],
  78 + 'route'=>'',
  79 + 'project_id'=>2837,
  80 + 'operator_id'=>6393,
  81 + 'module_id'=>2,
158 ]; 82 ];
159 - return $select; 83 + $customModuleCategoryModel = new CustomModuleCategory();
  84 + $catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]);
  85 + if($catInfo !== false){
  86 + $contentData['category_id'] = $catInfo['id'];
160 } 87 }
161 -  
162 - public function end_channel($channel){  
163 - if(!empty($channel)){  
164 - $parts = explode("-", $channel);  
165 - return end($parts); 88 + $customModuleContentModel = new CustomModuleContent();
  89 + $contentId = $customModuleContentModel->addReturnId($contentData);
  90 + $route = RouteMap::setRoute($array1[0],RouteMap::SOURCE_MODULE,$contentId,2837);
  91 + $customModuleContentModel->edit(['route'=>$route],['id'=>$contentId]);
  92 + $pd_extended_field_arr = [
  93 + [
  94 + 'key'=>'pd_extended_field_1',
  95 + 'type'=>1,
  96 + 'project_id'=>2837,
  97 + 'values'=>$array1[2],
  98 + 'content_id'=>$contentId,
  99 + 'module_id'=>2,
  100 + 'created_at'=>date('Y-m-d H:i:s'),
  101 + 'updated_at'=>date('Y-m-d H:i:s'),
  102 + ],
  103 + [
  104 + 'key'=>'pd_extended_field_2',
  105 + 'type'=>1,
  106 + 'project_id'=>2837,
  107 + 'values'=>$array1[3],
  108 + 'module_id'=>2,
  109 + 'content_id'=>$contentId,
  110 + 'created_at'=>date('Y-m-d H:i:s'),
  111 + 'updated_at'=>date('Y-m-d H:i:s'),
  112 + ],
  113 + [
  114 + 'key'=>'pd_extended_field_3',
  115 + 'type'=>1,
  116 + 'project_id'=>2837,
  117 + 'values'=>$array1[4],
  118 + 'module_id'=>2,
  119 + 'content_id'=>$contentId,
  120 + 'created_at'=>date('Y-m-d H:i:s'),
  121 + 'updated_at'=>date('Y-m-d H:i:s'),
  122 + ],
  123 + [
  124 + 'key'=>'pd_extended_field_4',
  125 + 'type'=>1,
  126 + 'project_id'=>2837,
  127 + 'values'=>$array1[5],
  128 + 'module_id'=>2,
  129 + 'content_id'=>$contentId,
  130 + 'created_at'=>date('Y-m-d H:i:s'),
  131 + 'updated_at'=>date('Y-m-d H:i:s'),
  132 + ],
  133 + [
  134 + 'key'=>'pd_extended_field_5',
  135 + 'type'=>1,
  136 + 'project_id'=>2837,
  137 + 'values'=>$array1[6],
  138 + 'module_id'=>2,
  139 + 'content_id'=>$contentId,
  140 + 'created_at'=>date('Y-m-d H:i:s'),
  141 + 'updated_at'=>date('Y-m-d H:i:s'),
  142 + ],
  143 + [
  144 + 'key'=>'pd_extended_field_6',
  145 + 'type'=>1,
  146 + 'project_id'=>2837,
  147 + 'values'=>$array1[7],
  148 + 'module_id'=>2,
  149 + 'content_id'=>$contentId,
  150 + 'created_at'=>date('Y-m-d H:i:s'),
  151 + 'updated_at'=>date('Y-m-d H:i:s'),
  152 + ],
  153 + [
  154 + 'key'=>'pd_extended_field_7',
  155 + 'type'=>1,
  156 + 'project_id'=>2837,
  157 + 'values'=>$array1[8],
  158 + 'module_id'=>2,
  159 + 'content_id'=>$contentId,
  160 + 'created_at'=>date('Y-m-d H:i:s'),
  161 + 'updated_at'=>date('Y-m-d H:i:s'),
  162 + ],
  163 + [
  164 + 'key'=>'pd_extended_field_8',
  165 + 'type'=>1,
  166 + 'project_id'=>2837,
  167 + 'values'=>$array1[9],
  168 + 'module_id'=>2,
  169 + 'content_id'=>$contentId,
  170 + 'created_at'=>date('Y-m-d H:i:s'),
  171 + 'updated_at'=>date('Y-m-d H:i:s'),
  172 + ],
  173 + [
  174 + 'key'=>'pd_extended_field_9',
  175 + 'type'=>1,
  176 + 'project_id'=>2837,
  177 + 'values'=>$array1[10],
  178 + 'module_id'=>2,
  179 + 'content_id'=>$contentId,
  180 + 'created_at'=>date('Y-m-d H:i:s'),
  181 + 'updated_at'=>date('Y-m-d H:i:s'),
  182 + ],
  183 + [
  184 + 'key'=>'pd_extended_field_10',
  185 + 'type'=>1,
  186 + 'project_id'=>2837,
  187 + 'values'=>$array1[11],
  188 + 'module_id'=>2,
  189 + 'content_id'=>$contentId,
  190 + 'created_at'=>date('Y-m-d H:i:s'),
  191 + 'updated_at'=>date('Y-m-d H:i:s'),
  192 + ],
  193 + [
  194 + 'key'=>'pd_extended_field_11',
  195 + 'type'=>1,
  196 + 'project_id'=>2837,
  197 + 'values'=>$array1[12],
  198 + 'module_id'=>2,
  199 + 'content_id'=>$contentId,
  200 + 'created_at'=>date('Y-m-d H:i:s'),
  201 + 'updated_at'=>date('Y-m-d H:i:s'),
  202 + ],
  203 + ];
  204 + $extendContentModel = new CustomModuleExtentContent();
  205 + $extendContentModel->insert($pd_extended_field_arr);
166 } 206 }
167 - return $channel;  
168 } 207 }
169 } 208 }
@@ -234,8 +234,8 @@ class ImageController extends Controller @@ -234,8 +234,8 @@ class ImageController extends Controller
234 $tran_name = $tran_name[0]; 234 $tran_name = $tran_name[0];
235 } 235 }
236 $enName = generateRoute($tran_name); 236 $enName = generateRoute($tran_name);
237 - if(substr($enName, 0, 1) === '-'){  
238 - $enName = md5(uniqid().$project_id.rand(1,1000));; 237 + if(substr($enName, 0, 1) === '-' || empty($enName)){
  238 + $enName = md5(uniqid().$project_id.rand(1,1000));
239 } 239 }
240 $fileName = $enName; 240 $fileName = $enName;
241 $i=1; 241 $i=1;
@@ -313,7 +313,11 @@ class KeywordLogic extends BaseLogic @@ -313,7 +313,11 @@ class KeywordLogic extends BaseLogic
313 $productIdArr = $keywordRelatedModel->selectField(['keyword_id'=>$keyword_id],'product_id'); 313 $productIdArr = $keywordRelatedModel->selectField(['keyword_id'=>$keyword_id],'product_id');
314 if(!empty($productIdArr)){ 314 if(!empty($productIdArr)){
315 $productModel = new Product(); 315 $productModel = new Product();
316 - $productList = $productModel->list(['id'=>['in',$productIdArr]],['id','title']); 316 + $productList = $productModel->list(['id'=>['in',$productIdArr]],['id','title','route']);
  317 + foreach ($productList as $k => $v){
  318 + $v['route'] = $this->user['domain'].$v['route'];
  319 + $productList[$k] = $v;
  320 + }
317 } 321 }
318 return $this->success($productList); 322 return $this->success($productList);
319 } 323 }
@@ -336,4 +340,31 @@ class KeywordLogic extends BaseLogic @@ -336,4 +340,31 @@ class KeywordLogic extends BaseLogic
336 return $this->success(); 340 return $this->success();
337 } 341 }
338 342
  343 + /**
  344 + * @remark :删除所有的关键字
  345 + * @name :delAllKeyword
  346 + * @author :lyh
  347 + * @method :post
  348 + * @time :2024/12/5 15:37
  349 + */
  350 + public function delAllKeyword(){
  351 + DB::beginTransaction();
  352 + try {
  353 + //截断关联表
  354 + KeywordRelated::truncate();
  355 + //截断关键词表
  356 + Keyword::truncate();
  357 + //清空产品表的keyword_id字段
  358 + $routeMapModel = new RouteMap();
  359 + $routeMapModel->del(['source'=>'product_keyword']);
  360 + $productModel = new Product();
  361 + $productModel->edit(['keyword_id'=>''],['id'=>['>',0]]);
  362 + DB::commit();
  363 + }catch (\Exception $e){
  364 + DB::rollBack();
  365 + $this->fail('操作失败,请联系管理员');
  366 + }
  367 + return $this->success();
  368 + }
  369 +
339 } 370 }
@@ -53,6 +53,7 @@ class Project extends Base @@ -53,6 +53,7 @@ class Project extends Base
53 3 => '告知书一', 53 3 => '告知书一',
54 4 => '告知书二', 54 4 => '告知书二',
55 5 => 'Q告知书二', 55 5 => 'Q告知书二',
  56 + 6 => 'CKA',
56 ]; 57 ];
57 } 58 }
58 59
@@ -132,9 +132,18 @@ class CosService @@ -132,9 +132,18 @@ class CosService
132 ], 132 ],
133 ]); 133 ]);
134 134
  135 + if(empty($body_str)){
135 try { 136 try {
136 - $body = $body_str ?:curl_c($file_url,false); 137 + $body_str = curl_c($file_url,false);
  138 + if(!$body_str){
  139 + $body_str = file_get_contents($file_url);
  140 + }
137 }catch (\Exception $e){ 141 }catch (\Exception $e){
  142 + $body_str = '';
  143 + }
  144 + }
  145 +
  146 + if(!$body_str){
138 return ''; 147 return '';
139 } 148 }
140 149
@@ -142,7 +151,7 @@ class CosService @@ -142,7 +151,7 @@ class CosService
142 $cosClient->putObject([ 151 $cosClient->putObject([
143 'Bucket' => $cos['bucket'], 152 'Bucket' => $cos['bucket'],
144 'Key' => $key, 153 'Key' => $key,
145 - 'Body' => $body, 154 + 'Body' => $body_str,
146 ]); 155 ]);
147 return $key; 156 return $key;
148 }catch (\Exception $e){ 157 }catch (\Exception $e){
@@ -282,6 +282,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -282,6 +282,7 @@ Route::middleware(['bloginauth'])->group(function () {
282 Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel'); 282 Route::post('keyword/batchDel', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchDel'])->name('product_keyword_batchDel');
283 Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete'); 283 Route::any('keyword/delete', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delete'])->name('product_keyword_delete');
284 Route::any('keyword/delRelated', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelated'])->name('product_keyword_delRelated'); 284 Route::any('keyword/delRelated', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelated'])->name('product_keyword_delRelated');
  285 + Route::any('keyword/delAllKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delAllKeyword'])->name('product_keyword_delAllKeyword');
285 Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword'); 286 Route::any('keyword/batchUpdateKeyword', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchUpdateKeyword'])->name('product_keyword_batchUpdateKeyword');
286 Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo'); 287 Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo');
287 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); 288 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');