作者 lyh
@@ -41,18 +41,18 @@ class HtmlCustomCollect extends Command @@ -41,18 +41,18 @@ class HtmlCustomCollect extends Command
41 { 41 {
42 ini_set('memory_limit', '512M'); 42 ini_set('memory_limit', '512M');
43 43
44 -// $project_id = 586;  
45 -// $project_site = 'v6-m605x.globalso.site';  
46 -// $pages = [  
47 -// 'https://www.citymax-group.com/case/',  
48 -// 'https://www.citymax-group.com/case_catalog/crop-classification/',  
49 -// 'https://www.citymax-group.com/case_catalog/field-crops/',  
50 -// 'https://www.citymax-group.com/case_catalog/fruits/',  
51 -// 'https://www.citymax-group.com/case_catalog/vegetables/',  
52 -// 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-grapes-2/',  
53 -// 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-cucumber/',  
54 -// 'https://www.citymax-group.com/case/field-experiment-crop-lettuce/',  
55 -// ]; 44 + $project_id = 586;
  45 + $project_site = 'v6-m605x.globalso.site';
  46 + $pages = [
  47 + 'https://www.citymax-group.com/case/',
  48 + 'https://www.citymax-group.com/case_catalog/crop-classification/',
  49 + 'https://www.citymax-group.com/case_catalog/field-crops/',
  50 + 'https://www.citymax-group.com/case_catalog/fruits/',
  51 + 'https://www.citymax-group.com/case_catalog/vegetables/',
  52 + 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-grapes-2/',
  53 + 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-cucumber/',
  54 + 'https://www.citymax-group.com/case/field-experiment-crop-lettuce/',
  55 + ];
56 56
57 // $project_id = 633; 57 // $project_id = 633;
58 // $project_site = 'v6-ke5nz.globalso.site'; 58 // $project_site = 'v6-ke5nz.globalso.site';
@@ -110,35 +110,35 @@ class HtmlCustomCollect extends Command @@ -110,35 +110,35 @@ class HtmlCustomCollect extends Command
110 // 'https://www.tourletent.com/project/tree-house-in-sichuan/' 110 // 'https://www.tourletent.com/project/tree-house-in-sichuan/'
111 // ]; 111 // ];
112 112
113 - $project_id = 626;  
114 - $project_site = 'v6-m342g.globalso.site';  
115 - $pages = [  
116 - 'https://www.lecusostreetlight.com/project_catalog/project/',  
117 - 'https://www.lecusostreetlight.com/project_catalog/project/page/2/',  
118 - 'https://www.lecusostreetlight.com/project/560pcs-250w-smart-led-street-light-in-manila-city-philippines/',  
119 - 'https://www.lecusostreetlight.com/project/3200pcs-8m-150w-solar-street-light-in-cebu-philippines/',  
120 - 'https://lecusostreetlight.com/project/170pcs-100w-split-lithium-battery-solar-street-light-in-tanzania/',  
121 - 'https://www.lecusostreetlight.com/project/250pcs-40w-sl-series-solar-street-light-in-kuwait/',  
122 - 'https://www.lecusostreetlight.com/project/272pcs-8m-80w-solar-street-light-in-tanzania/',  
123 - 'https://www.lecusostreetlight.com/project/185pcs-10m-120w-highway-solar-street-light-in-jordan/',  
124 - 'https://www.lecusostreetlight.com/project/270pcs-9m-patterned-decorative-light-pole-with-150w-led-cobra-light-in-cambodia/',  
125 - 'https://www.lecusostreetlight.com/project/48pcs-5m-24w-decorative-aluminium-pole-in-dubai-uae/',  
126 - 'https://www.lecusostreetlight.com/project/105pcs-9m-100w-led-street-light-in-sri-lanka/',  
127 - 'https://www.lecusostreetlight.com/project/45pcs-6m-hot-dip-galvanized-double-arm-street-light-pole-in-dubai-uae/',  
128 - 'https://www.lecusostreetlight.com/project/356pcs-8m-100w-solar-street-light-in-ethiopia/',  
129 - 'https://www.lecusostreetlight.com/project/52pcs-6m-30w-solar-led-street-light-with-gel-battery-in-poland/',  
130 - 'https://www.lecusostreetlight.com/project/225pcs-6m-80w-solar-street-light-in-vietnam/',  
131 - 'https://www.lecusostreetlight.com/project/450pcs-7m-60w-double-arm-solar-light-in-nigeria/',  
132 - 'https://www.lecusostreetlight.com/project/100pcs-6m-50w-led-street-light-in-maldives/',  
133 - 'https://www.lecusostreetlight.com/project/202pcs-6m-40w-3000k-solar-street-light-in-manila-philippines/',  
134 - 'https://www.lecusostreetlight.com/project/245pcs-120w-smart-led-street-light-in-bangkok-thailand/',  
135 - 'https://www.lecusostreetlight.com/project/170pcs-7m-50w-all-in-one-solar-light-in-davao-philippines/',  
136 - 'https://www.lecusostreetlight.com/project/80pcs-9m-150w-led-street-light-in-iraq/',  
137 - 'https://www.lecusostreetlight.com/project/252pcs-6m-40w-separate-solar-street-light-with-lithium-battery-in-thailand/',  
138 - 'https://www.lecusostreetlight.com/project/198pcs-8m-80w-zc-series-all-in-two-solar-light-in-philippines/',  
139 - 'https://www.lecusostreetlight.com/project/5m-30w-morden-led-garden-light-in-russian/',  
140 - 'https://www.lecusostreetlight.com/project/135pcs-all-in-one-solar-street-light-in-uae-dubai-park/'  
141 - ]; 113 +// $project_id = 626;
  114 +// $project_site = 'v6-m342g.globalso.site';
  115 +// $pages = [
  116 +// 'https://www.lecusostreetlight.com/project_catalog/project/',
  117 +// 'https://www.lecusostreetlight.com/project_catalog/project/page/2/',
  118 +// 'https://www.lecusostreetlight.com/project/560pcs-250w-smart-led-street-light-in-manila-city-philippines/',
  119 +// 'https://www.lecusostreetlight.com/project/3200pcs-8m-150w-solar-street-light-in-cebu-philippines/',
  120 +// 'https://lecusostreetlight.com/project/170pcs-100w-split-lithium-battery-solar-street-light-in-tanzania/',
  121 +// 'https://www.lecusostreetlight.com/project/250pcs-40w-sl-series-solar-street-light-in-kuwait/',
  122 +// 'https://www.lecusostreetlight.com/project/272pcs-8m-80w-solar-street-light-in-tanzania/',
  123 +// 'https://www.lecusostreetlight.com/project/185pcs-10m-120w-highway-solar-street-light-in-jordan/',
  124 +// 'https://www.lecusostreetlight.com/project/270pcs-9m-patterned-decorative-light-pole-with-150w-led-cobra-light-in-cambodia/',
  125 +// 'https://www.lecusostreetlight.com/project/48pcs-5m-24w-decorative-aluminium-pole-in-dubai-uae/',
  126 +// 'https://www.lecusostreetlight.com/project/105pcs-9m-100w-led-street-light-in-sri-lanka/',
  127 +// 'https://www.lecusostreetlight.com/project/45pcs-6m-hot-dip-galvanized-double-arm-street-light-pole-in-dubai-uae/',
  128 +// 'https://www.lecusostreetlight.com/project/356pcs-8m-100w-solar-street-light-in-ethiopia/',
  129 +// 'https://www.lecusostreetlight.com/project/52pcs-6m-30w-solar-led-street-light-with-gel-battery-in-poland/',
  130 +// 'https://www.lecusostreetlight.com/project/225pcs-6m-80w-solar-street-light-in-vietnam/',
  131 +// 'https://www.lecusostreetlight.com/project/450pcs-7m-60w-double-arm-solar-light-in-nigeria/',
  132 +// 'https://www.lecusostreetlight.com/project/100pcs-6m-50w-led-street-light-in-maldives/',
  133 +// 'https://www.lecusostreetlight.com/project/202pcs-6m-40w-3000k-solar-street-light-in-manila-philippines/',
  134 +// 'https://www.lecusostreetlight.com/project/245pcs-120w-smart-led-street-light-in-bangkok-thailand/',
  135 +// 'https://www.lecusostreetlight.com/project/170pcs-7m-50w-all-in-one-solar-light-in-davao-philippines/',
  136 +// 'https://www.lecusostreetlight.com/project/80pcs-9m-150w-led-street-light-in-iraq/',
  137 +// 'https://www.lecusostreetlight.com/project/252pcs-6m-40w-separate-solar-street-light-with-lithium-battery-in-thailand/',
  138 +// 'https://www.lecusostreetlight.com/project/198pcs-8m-80w-zc-series-all-in-two-solar-light-in-philippines/',
  139 +// 'https://www.lecusostreetlight.com/project/5m-30w-morden-led-garden-light-in-russian/',
  140 +// 'https://www.lecusostreetlight.com/project/135pcs-all-in-one-solar-street-light-in-uae-dubai-park/'
  141 +// ];
142 142
143 foreach ($pages as $page) { 143 foreach ($pages as $page) {
144 $this->start_collect(urldecode($page), $project_id, $project_site); 144 $this->start_collect(urldecode($page), $project_id, $project_site);
@@ -331,7 +331,7 @@ class ProjectUpdate extends Command @@ -331,7 +331,7 @@ class ProjectUpdate extends Command
331 $category_id = ''; 331 $category_id = '';
332 if ($api_type == 'news' && ($item['category'] ?? [])) { 332 if ($api_type == 'news' && ($item['category'] ?? [])) {
333 $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]); 333 $category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
334 - $category_id = $logic->getLastCategory(array_column($category_arr, 'id')); 334 + $category_id = $logic->getCategory(array_column($category_arr, 'id'));
335 } 335 }
336 try { 336 try {
337 $item['ttile'] = $this->special2str($item['ttile'] ?? ''); 337 $item['ttile'] = $this->special2str($item['ttile'] ?? '');
@@ -367,6 +367,13 @@ class ProjectUpdate extends Command @@ -367,6 +367,13 @@ class ProjectUpdate extends Command
367 echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL; 367 echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
368 continue; 368 continue;
369 } 369 }
  370 + }else{
  371 + if (is_array($item['images'])) {
  372 + $image = $item['images'][0] ?? '';
  373 + } else {
  374 + $image = $item['images'] ?? '';
  375 + }
  376 + $model->edit(['image' => $this->source_download($image, $project_id, $domain_arr['host'], $web_url_domain, $home_url)],['id'=>$news['id']]);
370 } 377 }
371 } 378 }
372 } 379 }
@@ -703,17 +703,17 @@ class ProjectLogic extends BaseLogic @@ -703,17 +703,17 @@ class ProjectLogic extends BaseLogic
703 } 703 }
704 704
705 /** 705 /**
706 - * @remark :保存其他配置  
707 - * @name :saveOtherProject  
708 - * @author :lyh  
709 - * @method :post  
710 - * @time :2023/11/17 15:26 706 + * 保存其他配置
  707 + * AICC、hagro、token
  708 + * @return array
  709 + * @throws AsideGlobalException
  710 + * @throws \App\Exceptions\BsideGlobalException
711 */ 711 */
712 public function saveOtherProject(){ 712 public function saveOtherProject(){
713 //获取当前数据详情 713 //获取当前数据详情
714 $projectInfo = $this->getProjectInfo($this->param['id']); 714 $projectInfo = $this->getProjectInfo($this->param['id']);
715 - //aicc  
716 - if(($projectInfo['aicc'] == Project::TYPE_ZERO) && ($this->param['aicc'] == Project::TYPE_ONE)){ 715 + //aicc if (($projectInfo['aicc'] == Project::TYPE_ZERO) && ($this->param['aicc'] == Project::TYPE_ONE)) 从关闭到开启状态才同步, 改成只要是开启状态就同步
  716 + if($this->param['aicc'] == Project::TYPE_ONE){
717 $data = [ 717 $data = [
718 'company_name'=>$projectInfo['company'], 718 'company_name'=>$projectInfo['company'],
719 'principal_mobile'=>$projectInfo['mobile'], 719 'principal_mobile'=>$projectInfo['mobile'],
@@ -723,8 +723,8 @@ class ProjectLogic extends BaseLogic @@ -723,8 +723,8 @@ class ProjectLogic extends BaseLogic
723 ]; 723 ];
724 $this->toAicc($data); 724 $this->toAicc($data);
725 } 725 }
726 - //黑格  
727 - if(($projectInfo['hagro'] == Project::TYPE_ZERO) && ($this->param['hagro'] == Project::TYPE_ONE)){ 726 + //黑格 从关闭到开启状态才同步, 改成只要是开启状态就同步, 需要修改有效时间
  727 + if($this->param['hagro'] == Project::TYPE_ONE){
728 $data = [ 728 $data = [
729 'company_name'=>$projectInfo['company'], 729 'company_name'=>$projectInfo['company'],
730 'principal_mobile'=>$projectInfo['mobile'], 730 'principal_mobile'=>$projectInfo['mobile'],