Commit d92ab8e7 authored by luhongguang's avatar luhongguang

update:同步商品脚本调整

parent 6dd1fb00
...@@ -244,6 +244,15 @@ class GoodstoinitController extends Cli ...@@ -244,6 +244,15 @@ class GoodstoinitController extends Cli
"rule_refund" => $ruleRefund, "rule_refund" => $ruleRefund,
]; ];
GoodsSpu::save($spuParams); GoodsSpu::save($spuParams);
} else {
$spuParams = [
"desc_pic_url" => $descPicUrl,
"desc" => $desc,
"rule_limit" => $ruleLimit,
"rule_desc" => $ruleDesc,
"rule_refund" => $ruleRefund,
];
GoodsSpu::save($spuParams, ["goods_spu_id"=>$goodsSpu["goods_spu_id"]]);
} }
$goodsSku = GoodsSku::getRecord(["life_account_id"=>$lifeAccountId, "goods_name"=>$goodsName]); $goodsSku = GoodsSku::getRecord(["life_account_id"=>$lifeAccountId, "goods_name"=>$goodsName]);
...@@ -277,6 +286,27 @@ class GoodstoinitController extends Cli ...@@ -277,6 +286,27 @@ class GoodstoinitController extends Cli
"is_import" => 1, "is_import" => 1,
]; ];
GoodsSku::save($skuParams); GoodsSku::save($skuParams);
} else {
$skuParams = [
"goods_name" => $goodsName,
"desc_pic_url" => $descPicUrl,
"desc" => $desc,
"introduce" => $introduce,
"introduce_pic_url" => $introducePicUrl,
"rule_limit" => $ruleLimit,
"rule_desc" => $ruleDesc,
"rule_refund" => $ruleRefund,
"rule_date_type" => $ruleDateType,
"rule_start_time" => $ruleStartTime,
"rule_end_time" => $ruleEndTime,
"inventory_total" => $inventoryTotal,
"inventory_rest" => $inventoryRest,
"total_amount_order" => $totalAmountOrder,
"total_amount_sold" => $totalAmountOrder,
"original_price" => $originalPrice,
"price" => $price,
];
GoodsSku::save($skuParams, ["goods_sku_id"=>$goodsSku["goods_sku_id"]]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment