Commit f9b3fa77 authored by luhongguang's avatar luhongguang

update: 导数据脚本测试完成

parent 7ecfbf57
......@@ -32,7 +32,7 @@ class GoodsToInitController extends Cli
//处理 shop 数据
$this->dealShopData($list);
//处理商品数据
// $this->dealGoodsData($list);
$this->dealGoodsData($list);
}
}
......@@ -228,53 +228,59 @@ class GoodsToInitController extends Cli
$originalPrice = $item["price"] * 100;
$price = $item["rawPrice"] * 100;
$spuParams = [
"goods_spu_id" => $goodsSpuId,
"shop_id" => $shopId,
"life_account_id" => $lifeAccountId,
"publish_user_id" => $publicUserId,
"goods_name" => $goodsName,
"desc_pic_url" => $descPicUrl,
"desc" => $desc,
"goods_type" => GoodsSpu::TYPE_VIRTUAL,
"goods_sub_type" => GoodsSpu::SUB_TYPE_TO_SHOP,
"goods_sale_type" => GoodsSpu::SALE_TYPE_NO_COMBINATION,
"rule_limit" => $ruleLimit,
"rule_desc" => $ruleDesc,
"rule_refund" => $ruleRefund,
];
GoodsSpu::save($spuParams);
$goodsSpu = GoodsSpu::getRecord(["life_account_id"=>$lifeAccountId, "goods_name"=>$goodsName]);
if (empty($goodsSpu)) {
$spuParams = [
"goods_spu_id" => $goodsSpuId,
"shop_id" => $shopId,
"life_account_id" => $lifeAccountId,
"publish_user_id" => $publicUserId,
"goods_name" => $goodsName,
"desc_pic_url" => $descPicUrl,
"desc" => $desc,
"goods_type" => GoodsSpu::TYPE_VIRTUAL,
"goods_sub_type" => GoodsSpu::SUB_TYPE_TO_SHOP,
"goods_sale_type" => GoodsSpu::SALE_TYPE_NO_COMBINATION,
"rule_limit" => $ruleLimit,
"rule_desc" => $ruleDesc,
"rule_refund" => $ruleRefund,
];
GoodsSpu::save($spuParams);
}
$skuParams = [
"goods_sku_id" => $goodsSkuId,
"goods_spu_id" => $goodsSpuId,
"life_account_id" => $lifeAccountId,
"shop_id" => $shopId,
"publish_user_id" => $publicUserId,
"category_1_id" => $categoryOneId,
"category_2_id" => $categoryTwoId,
"goods_name" => $goodsName,
"desc_pic_url" => $descPicUrl,
"desc" => $desc,
"introduce" => $introduce,
"introduce_pic_url" => $introducePicUrl,
"expiration_time" => $expirationTime,
"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,
"is_import" => 1,
];
$goodsSku = GoodsSku::getRecord(["life_account_id"=>$lifeAccountId, "goods_name"=>$goodsName]);
if (empty($goodsSku)) {
$skuParams = [
"goods_sku_id" => $goodsSkuId,
"goods_spu_id" => $goodsSpuId,
"life_account_id" => $lifeAccountId,
"shop_id" => $shopId,
"publish_user_id" => $publicUserId,
"category_1_id" => $categoryOneId,
"category_2_id" => $categoryTwoId,
"goods_name" => $goodsName,
"desc_pic_url" => $descPicUrl,
"desc" => $desc,
"introduce" => $introduce,
"introduce_pic_url" => $introducePicUrl,
"expiration_time" => $expirationTime,
"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,
"is_import" => 1,
];
GoodsSku::save($skuParams);
}
GoodsSku::save($skuParams);
$subShop = json_decode($item["shopJson"], true);
if (!empty($subShop)) {
......
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