作者 lyh

gx

... ... @@ -54,7 +54,7 @@ class LyhImportTest extends Command
public function handle(){
ProjectServer::useProject(3283);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
$this->importProduct('https://ecdn6.globalso.com/upload/p/3283/file/2025-03/2-1.csv',3283);
// $this->importProduct('https://ecdn6.globalso.com/upload/p/3283/file/2025-03/2-1.csv',3283);
DB::disconnect('custom_mysql');
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ...
... ... @@ -66,10 +66,11 @@ class UpdateRoute extends Command
foreach ($lists as $v){
echo date('Y-m-d H:i:s') . '执行项目的project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->updateSeo($v['id']);
$this->updateSeo();
DB::disconnect('custom_mysql');
}
// $this->updateProjectOp();
// $projectModel = new Project();
// $lists = $projectModel->list(['delete_status'=>0],'id',['id']);
... ... @@ -526,22 +527,9 @@ class UpdateRoute extends Command
* @method :post
* @time :2025/3/14 14:39
*/
public function updateSeo($project_id){
$seoModel = new WebSettingSeo();
$seo_info = $seoModel->read(['project_id'=>$project_id]);
if($seo_info !== false){
$prefix = [];
$suffix = [];
if(!empty($seo_info['product_cate_prefix'])){
$prefix[] = ['val'=>[$seo_info['product_cate_prefix']],'level'=>1];
}
if(!empty($seo_info['product_cate_suffix'])){
$suffix[] = ['val'=>[$seo_info['product_cate_suffix']],'level'=>1];
}
if(!empty($prefix) && !empty($suffix)){
$seoModel->edit(['product_category_prefix'=>json_encode($prefix,true),'product_category_suffix'=>json_encode($suffix,true)],['project_id'=>$project_id]);
}
}
public function updateSeo(){
$contentModel = new CustomModuleContent();
$contentModel->edit(['seo_title'=>''],['id'=>['!=',0]]);
return true;
}
}
... ...