作者 刘锟

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

@@ -69,7 +69,7 @@ class ReplaceHtml extends Command @@ -69,7 +69,7 @@ class ReplaceHtml extends Command
69 foreach ($replaceHtmlList as $v){ 69 foreach ($replaceHtmlList as $v){
70 ProjectServer::useProject($v['project_id']); 70 ProjectServer::useProject($v['project_id']);
71 echo '开始,任务id:'.$v['id'].PHP_EOL; 71 echo '开始,任务id:'.$v['id'].PHP_EOL;
72 - if($v['source'] == 9){//单页面 72 + if(($v['source'] == 9) && ($v['is_custom'] == 0)){//单页面
73 $count = $this->createReplacePageHtmlLog($v); 73 $count = $this->createReplacePageHtmlLog($v);
74 }else{ 74 }else{
75 $count = $this->createReplaceHtmlLog($v); 75 $count = $this->createReplaceHtmlLog($v);
@@ -334,7 +334,7 @@ class ReplaceHtml extends Command @@ -334,7 +334,7 @@ class ReplaceHtml extends Command
334 } 334 }
335 if($is_list == BTemplate::IS_LIST){ 335 if($is_list == BTemplate::IS_LIST){
336 $categoryModel = new CustomModuleCategory(); 336 $categoryModel = new CustomModuleCategory();
337 - $cateInfo = $categoryModel->read(['id'=>$source_id],['id','name']); 337 + $cateInfo = $categoryModel->read(['id'=>$source_id],['id','name','route']);
338 if($cateInfo === false){ 338 if($cateInfo === false){
339 return false; 339 return false;
340 } 340 }
@@ -342,7 +342,7 @@ class ReplaceHtml extends Command @@ -342,7 +342,7 @@ class ReplaceHtml extends Command
342 $route = $cateInfo['route']; 342 $route = $cateInfo['route'];
343 }else{ 343 }else{
344 $contentModel = new CustomModuleContent(); 344 $contentModel = new CustomModuleContent();
345 - $contentInfo = $contentModel->read(['id'=>$source_id],['id','name']); 345 + $contentInfo = $contentModel->read(['id'=>$source_id],['id','name','route']);
346 if($contentInfo === false){ 346 if($contentInfo === false){
347 return false; 347 return false;
348 } 348 }
@@ -33,30 +33,26 @@ class SyncImage extends Command @@ -33,30 +33,26 @@ class SyncImage extends Command
33 33
34 34
35 // public function handle(){ 35 // public function handle(){
36 -// $str = $this->getProjectConfig(501); 36 +// $str = $this->getProjectConfig(1808);
37 // $imageModel = new Image(); 37 // $imageModel = new Image();
38 -// $lists = $imageModel->list(['project_id'=>501]); 38 +// $str_image = '/upload/p/1808/image_product/2024-09/ppp.png,/upload/p/1808/image_product/2024-09/86e4866b-7432-40c1-8c06-d335cd736e29.png,/upload/p/1808/image_product/2024-09/7fd109cc-56f4-457c-a9c4-c3fa8d8195b2.png,/upload/p/1808/image_product/2024-09/1.png,/upload/p/1808/image_product/2024-08/bxb12501-3-1.png,/upload/p/1808/image_product/2024-08/bxa10801-3-1.png,/upload/p/1808/image_product/2024-08/bxa007-3-1.png,/upload/p/1808/image_product/2024-08/auto-parts-rectifier-bxf1070-for-alternator-1-1.png,/upload/p/1808/image_product/2024-08/auto-parts-rectifier-bxd1102-for-alternator-2-1.png,/upload/p/1808/image_product/2024-08/11407-3-1.png,/upload/p/1808/image_product/2024-07/gfjty.jpg,/upload/p/1808/image_product/2024-07/bxn11508-g1-2.png,/upload/p/1808/image_product/2024-07/bxn11508-g1-1.png,/upload/p/1808/image_product/2024-07/bxb12501-2.png,/upload/p/1808/image_product/2024-07/bxb12501-1.png,/upload/p/1808/image_product/2024-07/bxb1209-2.png,/upload/p/1808/image_product/2024-07/bxb1209-1.png,/upload/p/1808/image_product/2024-07/bxa10801-2.png,/upload/p/1808/image_product/2024-07/bxa10801-1.png,/upload/p/1808/image_product/2024-07/bxa007-2.png,/upload/p/1808/image_product/2024-07/bxa007-1.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxf6102-for-alternator-2.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxf1070-for-alternator-3.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxf1070-for-alternator-2.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxd9410-for-alternator-1.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxd1102-for-alternator-3.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxd1102-for-alternator-1.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxb12807-for-alternator-2.png,/upload/p/1808/image_product/2024-07/auto-parts-rectifier-bxb12807-for-alternator-1.png,/upload/p/1808/image_product/2024-07/11407-2.png,/upload/p/1808/image_product/2024-07/11407-1.png';
  39 +// $lists = explode(',',$str_image);
39 // $domain = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';//cos域名 40 // $domain = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';//cos域名
40 -// foreach ($lists as $k => $v){  
41 -// if($v['path'] == '/upload/p/501/image_product/2024-09/6569ac3a212aa39368.png'){  
42 -// continue;  
43 -// }  
44 -// $url = $domain . $v['path'].'?'.$str;  
45 -// echo date('Y-m-d H:i:s') . '水印路径:'. $url .',主键id:'. $v['id'] . PHP_EOL;  
46 -// $this->coverOriginalImage($url,$v['path']); 41 +// foreach ($lists as $v){
  42 +// $url = $domain . $v.'?'.$str;
  43 +// echo date('Y-m-d H:i:s') . '水印路径:'. $url . PHP_EOL;
  44 +// $cdu_url = $this->coverOriginalImage($url,$v);
  45 +// echo date('Y-m-d H:i:s') . '返回的url:'. $cdu_url . PHP_EOL;
47 // } 46 // }
48 // return true; 47 // return true;
49 // } 48 // }
50 49
51 public function handle(){ 50 public function handle(){
52 $data = []; 51 $data = [];
53 - $domain = 'https://ecdn6-nc.globalso.com/'; 52 + $domain = 'https://ecdn6.globalso.com/';
54 $imageModel = new Image(); 53 $imageModel = new Image();
55 - $lists = $imageModel->list(['project_id'=>501]); 54 + $lists = $imageModel->list(['project_id'=>1808]);
56 foreach ($lists as $k => $v){ 55 foreach ($lists as $k => $v){
57 - if($v['path'] == '/upload/p/501/image_product/2024-09/6569ac3a212aa39368.png'){  
58 - continue;  
59 - }  
60 $url = $domain . $v['path']; 56 $url = $domain . $v['path'];
61 echo date('Y-m-d H:i:s') . '刷新路径:'. $url .',主键id:'. $v['id'] . PHP_EOL; 57 echo date('Y-m-d H:i:s') . '刷新路径:'. $url .',主键id:'. $v['id'] . PHP_EOL;
62 $data[] = $url; 58 $data[] = $url;
@@ -84,7 +84,7 @@ class OperationHeartbeatController extends BaseController @@ -84,7 +84,7 @@ class OperationHeartbeatController extends BaseController
84 if($info === false){ 84 if($info === false){
85 $info = []; 85 $info = [];
86 }else{ 86 }else{
87 - $date_time = strtotime($info['updated_at']) + 7200; 87 + $date_time = strtotime($info['updated_at']) + 120;
88 if($date_time < time()){ 88 if($date_time < time()){
89 $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition); 89 $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition);
90 $info['status'] = 0; 90 $info['status'] = 0;
@@ -69,7 +69,7 @@ class ReplaceHtmlLogic extends BaseLogic @@ -69,7 +69,7 @@ class ReplaceHtmlLogic extends BaseLogic
69 */ 69 */
70 public function getCustomTemplateId($typeInfo,$template_id){ 70 public function getCustomTemplateId($typeInfo,$template_id){
71 $customModuleModel = new CustomModule(); 71 $customModuleModel = new CustomModule();
72 - $moduleInfo = $customModuleModel->read(['id'=>$typeInfo['type']],['list_customized','detail_customized']); 72 + $moduleInfo = $customModuleModel->read(['id'=>$typeInfo['source']],['list_customized','detail_customized']);
73 if($moduleInfo === false){ 73 if($moduleInfo === false){
74 $this->fail('当前扩展模块不存在或已被删除'); 74 $this->fail('当前扩展模块不存在或已被删除');
75 } 75 }
@@ -350,6 +350,8 @@ class ProductLogic extends BaseLogic @@ -350,6 +350,8 @@ class ProductLogic extends BaseLogic
350 DB::connection('custom_mysql')->beginTransaction(); 350 DB::connection('custom_mysql')->beginTransaction();
351 try { 351 try {
352 $cateRelate = new CategoryRelated(); 352 $cateRelate = new CategoryRelated();
  353 + //删除扩展字段
  354 + $extendInfoModel = new ExtendInfo();
353 foreach ($this->param['ids'] as $id) { 355 foreach ($this->param['ids'] as $id) {
354 $info = $this->model->read(['id'=>$id],['id','status']); 356 $info = $this->model->read(['id'=>$id],['id','status']);
355 if($info['status'] == Product::STATUS_RECYCLE){ 357 if($info['status'] == Product::STATUS_RECYCLE){
@@ -359,6 +361,7 @@ class ProductLogic extends BaseLogic @@ -359,6 +361,7 @@ class ProductLogic extends BaseLogic
359 $this->model->del(['id'=>$id]); 361 $this->model->del(['id'=>$id]);
360 //删除关联表 362 //删除关联表
361 $cateRelate->del(['product_id'=>$id]); 363 $cateRelate->del(['product_id'=>$id]);
  364 + $extendInfoModel->del(['product_id'=>$id]);
362 }else{ 365 }else{
363 //回收站 366 //回收站
364 $this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]); 367 $this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]);