作者 李宇航

合并分支 'lyh-server' 到 'master'

gx数据



查看合并请求 !1426
... ... @@ -53,8 +53,8 @@ class LyhImportTest extends Command
public function handle(){
ProjectServer::useProject(3283);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
$this->importProductCategory('https://ecdn6.globalso.com/upload/p/3283/file/2025-03/zy_boss_pricelistcat_202503131025.csv','3283');
// $this->importProduct('https://ecdn6.globalso.com/upload/p/1/file/2025-03/zy_boss_price_copy1.csv',3283);
// $this->importProductCategory('https://ecdn6.globalso.com/upload/p/3283/file/2025-03/zy_boss_pricelistcat_202503131025.csv','3283');
$this->importProduct('https://ecdn6.globalso.com/upload/p/3283/file/2025-03/zy_boss_price_copy1_202503121340.csv',3283);
DB::disconnect('custom_mysql');
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ... @@ -139,6 +139,7 @@ class LyhImportTest extends Command
$cateModel = new Category();
$productModel = new Product();
$detailModel = new Detail();
$columnModel = new Column();
foreach ($line_of_text as $k => $val){
if($k < 2){
continue;
... ... @@ -180,6 +181,13 @@ class LyhImportTest extends Command
'content'=>json_encode(['content'=>$val[3]])
];
$detailModel->addReturnId($detail);
//扩展描述设置
$detailFaq = [
'column_name'=>'FAQs',
'product_id'=>$id
];
$faqId = $columnModel->addReturnId($detailFaq);
$faqsDetail = json_decode($val[4],true);
if(!empty($faqsDetail) && is_array($faqsDetail)){
$faqContent = '<div>';
... ... @@ -189,7 +197,7 @@ class LyhImportTest extends Command
$faqContent .= '</div>';
$detailFaqInfo = [
'product_id'=>$id,
'column_id'=>1,
'column_id'=>$faqId,
'text_type'=>1,
'content'=>json_encode(['content'=>$faqContent])
];
... ...