作者 lyh
... ... @@ -41,18 +41,18 @@ class HtmlCustomCollect extends Command
{
ini_set('memory_limit', '512M');
// $project_id = 586;
// $project_site = 'v6-m605x.globalso.site';
// $pages = [
// 'https://www.citymax-group.com/case/',
// 'https://www.citymax-group.com/case_catalog/crop-classification/',
// 'https://www.citymax-group.com/case_catalog/field-crops/',
// 'https://www.citymax-group.com/case_catalog/fruits/',
// 'https://www.citymax-group.com/case_catalog/vegetables/',
// 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-grapes-2/',
// 'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-cucumber/',
// 'https://www.citymax-group.com/case/field-experiment-crop-lettuce/',
// ];
$project_id = 586;
$project_site = 'v6-m605x.globalso.site';
$pages = [
'https://www.citymax-group.com/case/',
'https://www.citymax-group.com/case_catalog/crop-classification/',
'https://www.citymax-group.com/case_catalog/field-crops/',
'https://www.citymax-group.com/case_catalog/fruits/',
'https://www.citymax-group.com/case_catalog/vegetables/',
'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-grapes-2/',
'https://www.citymax-group.com/case/report-on-use-of-citymax-products-on-cucumber/',
'https://www.citymax-group.com/case/field-experiment-crop-lettuce/',
];
// $project_id = 633;
// $project_site = 'v6-ke5nz.globalso.site';
... ... @@ -110,35 +110,35 @@ class HtmlCustomCollect extends Command
// 'https://www.tourletent.com/project/tree-house-in-sichuan/'
// ];
$project_id = 626;
$project_site = 'v6-m342g.globalso.site';
$pages = [
'https://www.lecusostreetlight.com/project_catalog/project/',
'https://www.lecusostreetlight.com/project_catalog/project/page/2/',
'https://www.lecusostreetlight.com/project/560pcs-250w-smart-led-street-light-in-manila-city-philippines/',
'https://www.lecusostreetlight.com/project/3200pcs-8m-150w-solar-street-light-in-cebu-philippines/',
'https://lecusostreetlight.com/project/170pcs-100w-split-lithium-battery-solar-street-light-in-tanzania/',
'https://www.lecusostreetlight.com/project/250pcs-40w-sl-series-solar-street-light-in-kuwait/',
'https://www.lecusostreetlight.com/project/272pcs-8m-80w-solar-street-light-in-tanzania/',
'https://www.lecusostreetlight.com/project/185pcs-10m-120w-highway-solar-street-light-in-jordan/',
'https://www.lecusostreetlight.com/project/270pcs-9m-patterned-decorative-light-pole-with-150w-led-cobra-light-in-cambodia/',
'https://www.lecusostreetlight.com/project/48pcs-5m-24w-decorative-aluminium-pole-in-dubai-uae/',
'https://www.lecusostreetlight.com/project/105pcs-9m-100w-led-street-light-in-sri-lanka/',
'https://www.lecusostreetlight.com/project/45pcs-6m-hot-dip-galvanized-double-arm-street-light-pole-in-dubai-uae/',
'https://www.lecusostreetlight.com/project/356pcs-8m-100w-solar-street-light-in-ethiopia/',
'https://www.lecusostreetlight.com/project/52pcs-6m-30w-solar-led-street-light-with-gel-battery-in-poland/',
'https://www.lecusostreetlight.com/project/225pcs-6m-80w-solar-street-light-in-vietnam/',
'https://www.lecusostreetlight.com/project/450pcs-7m-60w-double-arm-solar-light-in-nigeria/',
'https://www.lecusostreetlight.com/project/100pcs-6m-50w-led-street-light-in-maldives/',
'https://www.lecusostreetlight.com/project/202pcs-6m-40w-3000k-solar-street-light-in-manila-philippines/',
'https://www.lecusostreetlight.com/project/245pcs-120w-smart-led-street-light-in-bangkok-thailand/',
'https://www.lecusostreetlight.com/project/170pcs-7m-50w-all-in-one-solar-light-in-davao-philippines/',
'https://www.lecusostreetlight.com/project/80pcs-9m-150w-led-street-light-in-iraq/',
'https://www.lecusostreetlight.com/project/252pcs-6m-40w-separate-solar-street-light-with-lithium-battery-in-thailand/',
'https://www.lecusostreetlight.com/project/198pcs-8m-80w-zc-series-all-in-two-solar-light-in-philippines/',
'https://www.lecusostreetlight.com/project/5m-30w-morden-led-garden-light-in-russian/',
'https://www.lecusostreetlight.com/project/135pcs-all-in-one-solar-street-light-in-uae-dubai-park/'
];
// $project_id = 626;
// $project_site = 'v6-m342g.globalso.site';
// $pages = [
// 'https://www.lecusostreetlight.com/project_catalog/project/',
// 'https://www.lecusostreetlight.com/project_catalog/project/page/2/',
// 'https://www.lecusostreetlight.com/project/560pcs-250w-smart-led-street-light-in-manila-city-philippines/',
// 'https://www.lecusostreetlight.com/project/3200pcs-8m-150w-solar-street-light-in-cebu-philippines/',
// 'https://lecusostreetlight.com/project/170pcs-100w-split-lithium-battery-solar-street-light-in-tanzania/',
// 'https://www.lecusostreetlight.com/project/250pcs-40w-sl-series-solar-street-light-in-kuwait/',
// 'https://www.lecusostreetlight.com/project/272pcs-8m-80w-solar-street-light-in-tanzania/',
// 'https://www.lecusostreetlight.com/project/185pcs-10m-120w-highway-solar-street-light-in-jordan/',
// 'https://www.lecusostreetlight.com/project/270pcs-9m-patterned-decorative-light-pole-with-150w-led-cobra-light-in-cambodia/',
// 'https://www.lecusostreetlight.com/project/48pcs-5m-24w-decorative-aluminium-pole-in-dubai-uae/',
// 'https://www.lecusostreetlight.com/project/105pcs-9m-100w-led-street-light-in-sri-lanka/',
// 'https://www.lecusostreetlight.com/project/45pcs-6m-hot-dip-galvanized-double-arm-street-light-pole-in-dubai-uae/',
// 'https://www.lecusostreetlight.com/project/356pcs-8m-100w-solar-street-light-in-ethiopia/',
// 'https://www.lecusostreetlight.com/project/52pcs-6m-30w-solar-led-street-light-with-gel-battery-in-poland/',
// 'https://www.lecusostreetlight.com/project/225pcs-6m-80w-solar-street-light-in-vietnam/',
// 'https://www.lecusostreetlight.com/project/450pcs-7m-60w-double-arm-solar-light-in-nigeria/',
// 'https://www.lecusostreetlight.com/project/100pcs-6m-50w-led-street-light-in-maldives/',
// 'https://www.lecusostreetlight.com/project/202pcs-6m-40w-3000k-solar-street-light-in-manila-philippines/',
// 'https://www.lecusostreetlight.com/project/245pcs-120w-smart-led-street-light-in-bangkok-thailand/',
// 'https://www.lecusostreetlight.com/project/170pcs-7m-50w-all-in-one-solar-light-in-davao-philippines/',
// 'https://www.lecusostreetlight.com/project/80pcs-9m-150w-led-street-light-in-iraq/',
// 'https://www.lecusostreetlight.com/project/252pcs-6m-40w-separate-solar-street-light-with-lithium-battery-in-thailand/',
// 'https://www.lecusostreetlight.com/project/198pcs-8m-80w-zc-series-all-in-two-solar-light-in-philippines/',
// 'https://www.lecusostreetlight.com/project/5m-30w-morden-led-garden-light-in-russian/',
// 'https://www.lecusostreetlight.com/project/135pcs-all-in-one-solar-street-light-in-uae-dubai-park/'
// ];
foreach ($pages as $page) {
$this->start_collect(urldecode($page), $project_id, $project_site);
... ...
... ... @@ -331,7 +331,7 @@ class ProjectUpdate extends Command
$category_id = '';
if ($api_type == 'news' && ($item['category'] ?? [])) {
$category_arr = $category_model->list(['original_id' => ['in', array_column($item['category'], 'id')]]);
$category_id = $logic->getLastCategory(array_column($category_arr, 'id'));
$category_id = $logic->getCategory(array_column($category_arr, 'id'));
}
try {
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
... ... @@ -367,6 +367,13 @@ class ProjectUpdate extends Command
echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', error: ' . $e->getMessage() . PHP_EOL;
continue;
}
}else{
if (is_array($item['images'])) {
$image = $item['images'][0] ?? '';
} else {
$image = $item['images'] ?? '';
}
$model->edit(['image' => $this->source_download($image, $project_id, $domain_arr['host'], $web_url_domain, $home_url)],['id'=>$news['id']]);
}
}
}
... ...
... ... @@ -703,17 +703,17 @@ class ProjectLogic extends BaseLogic
}
/**
* @remark :保存其他配置
* @name :saveOtherProject
* @author :lyh
* @method :post
* @time :2023/11/17 15:26
* 保存其他配置
* AICC、hagro、token
* @return array
* @throws AsideGlobalException
* @throws \App\Exceptions\BsideGlobalException
*/
public function saveOtherProject(){
//获取当前数据详情
$projectInfo = $this->getProjectInfo($this->param['id']);
//aicc
if(($projectInfo['aicc'] == Project::TYPE_ZERO) && ($this->param['aicc'] == Project::TYPE_ONE)){
//aicc if (($projectInfo['aicc'] == Project::TYPE_ZERO) && ($this->param['aicc'] == Project::TYPE_ONE)) 从关闭到开启状态才同步, 改成只要是开启状态就同步
if($this->param['aicc'] == Project::TYPE_ONE){
$data = [
'company_name'=>$projectInfo['company'],
'principal_mobile'=>$projectInfo['mobile'],
... ... @@ -723,8 +723,8 @@ class ProjectLogic extends BaseLogic
];
$this->toAicc($data);
}
//黑格
if(($projectInfo['hagro'] == Project::TYPE_ZERO) && ($this->param['hagro'] == Project::TYPE_ONE)){
//黑格 从关闭到开启状态才同步, 改成只要是开启状态就同步, 需要修改有效时间
if($this->param['hagro'] == Project::TYPE_ONE){
$data = [
'company_name'=>$projectInfo['company'],
'principal_mobile'=>$projectInfo['mobile'],
... ...