Commit 6cb88e3b authored by luhongguang's avatar luhongguang

update:字段调整

parent ddda9ccb
...@@ -122,9 +122,9 @@ class GoodsService ...@@ -122,9 +122,9 @@ class GoodsService
"name" => $spuData["name"], "name" => $spuData["name"],
"url" => $spuData["url"], "url" => $spuData["url"],
"desc" => $spuData["desc"], "desc" => $spuData["desc"],
"type" => GoodsSpu::TYPE_VIRTUAL, "goods_type" => GoodsSpu::TYPE_VIRTUAL,
"sub_type" => GoodsSpu::SUB_TYPE_TO_SHOP, "goods_sub_type" => GoodsSpu::SUB_TYPE_TO_SHOP,
"sale_type" => empty($spuData["setmeal"]) ? GoodsSpu::SALE_TYPE_NO_COMBINATION : GoodsSpu::SALE_TYPE_COMBINATION, "goods_sale_type" => empty($spuData["setmeal"]) ? GoodsSpu::SALE_TYPE_NO_COMBINATION : GoodsSpu::SALE_TYPE_COMBINATION,
"rule_limit" => $spuData["rule_limit"], "rule_limit" => $spuData["rule_limit"],
"rule_desc" => $spuData["rule_desc"], "rule_desc" => $spuData["rule_desc"],
"rule_refund" => $spuData["rule_refund"], "rule_refund" => $spuData["rule_refund"],
...@@ -147,7 +147,7 @@ class GoodsService ...@@ -147,7 +147,7 @@ class GoodsService
if (empty($res)) { if (empty($res)) {
throw new GoodsException(['cus' => 2]); throw new GoodsException(['cus' => 2]);
} }
$skuId = GoodsSkuId::generateGoodSkuId($res[0], $skuData["category_1_id"], $skuData["category_2_id"], $spuData["type"]); $skuId = GoodsSkuId::generateGoodSkuId($res[0], $skuData["category_1_id"], $skuData["category_2_id"], $spuData["goods_type"]);
if ($skuData["expiration_time"] < date("Y-m-d H:i:s")) { if ($skuData["expiration_time"] < date("Y-m-d H:i:s")) {
throw new GoodsException(['cus' => 16]); throw new GoodsException(['cus' => 16]);
...@@ -288,8 +288,8 @@ class GoodsService ...@@ -288,8 +288,8 @@ class GoodsService
"operator_name" => $operatorName, "operator_name" => $operatorName,
"goods_status" => $status, "goods_status" => $status,
"online_status" => $sku["online_status"], "online_status" => $sku["online_status"],
"before_version" => $sku["version"], "before_version" => $sku["goods_version"],
"after_version" => $sku["version"], "after_version" => $sku["goods_version"],
"note" => empty($params["rejected_reason"]) ? "" : $params["rejected_reason"], "note" => empty($params["rejected_reason"]) ? "" : $params["rejected_reason"],
]; ];
GoodsOperationRecord::insertRecord($record); GoodsOperationRecord::insertRecord($record);
...@@ -350,8 +350,8 @@ class GoodsService ...@@ -350,8 +350,8 @@ class GoodsService
"operator_name" => $operatorName, "operator_name" => $operatorName,
"goods_status" => $sku["status"], "goods_status" => $sku["status"],
"online_status" => $onlineStatus, "online_status" => $onlineStatus,
"before_version" => $sku["version"], "before_version" => $sku["goods_version"],
"after_version" => $sku["version"], "after_version" => $sku["goods_version"],
"note" => empty($params["rejected_reason"]) ? "" : $params["rejected_reason"], "note" => empty($params["rejected_reason"]) ? "" : $params["rejected_reason"],
]; ];
GoodsOperationRecord::insertRecord($record); GoodsOperationRecord::insertRecord($record);
...@@ -449,9 +449,9 @@ class GoodsService ...@@ -449,9 +449,9 @@ class GoodsService
"name" => $params["name"], "name" => $params["name"],
"url" => $params["url"], "url" => $params["url"],
"desc" => $params["desc"], "desc" => $params["desc"],
"type" => GoodsSpu::TYPE_VIRTUAL, "goods_type" => GoodsSpu::TYPE_VIRTUAL,
"sub_type" => GoodsSpu::SUB_TYPE_TO_SHOP, "goods_sub_type" => GoodsSpu::SUB_TYPE_TO_SHOP,
"sale_type" => empty($params["setmeal"]) ? GoodsSpu::SALE_TYPE_NO_COMBINATION : GoodsSpu::SALE_TYPE_COMBINATION, "goods_sale_type" => empty($params["setmeal"]) ? GoodsSpu::SALE_TYPE_NO_COMBINATION : GoodsSpu::SALE_TYPE_COMBINATION,
"rule_limit" => $params["rule_limit"], "rule_limit" => $params["rule_limit"],
"rule_desc" => $params["rule_desc"], "rule_desc" => $params["rule_desc"],
"rule_refund" => $params["rule_refund"], "rule_refund" => $params["rule_refund"],
...@@ -507,7 +507,7 @@ class GoodsService ...@@ -507,7 +507,7 @@ class GoodsService
"inventory_rest" => $inventoryCount, "inventory_rest" => $inventoryCount,
"original_price" => $params["original_price"] * 100, "original_price" => $params["original_price"] * 100,
"price" => $params["price"] * 100, "price" => $params["price"] * 100,
"version" => (int)$skuData["version"] + 1, "goods_version" => (int)$skuData["goods_version"] + 1,
]; ];
if (self::isInitGoodsStatus($params, $skuData)) { if (self::isInitGoodsStatus($params, $skuData)) {
$skuParams["status"] = GoodsSku::STATUS_AUDIT; $skuParams["status"] = GoodsSku::STATUS_AUDIT;
...@@ -532,8 +532,8 @@ class GoodsService ...@@ -532,8 +532,8 @@ class GoodsService
"operator_name" => $params["user_name"], "operator_name" => $params["user_name"],
"goods_status" => GoodsSku::STATUS_AUDIT, "goods_status" => GoodsSku::STATUS_AUDIT,
"online_status" => GoodsSku::ONLINE_STATUS_NO_ONLINE, "online_status" => GoodsSku::ONLINE_STATUS_NO_ONLINE,
"before_version" => $skuData["version"], "before_version" => $skuData["goods_version"],
"after_version" => $skuParams["version"], "after_version" => $skuParams["goods_version"],
"note" => empty($params["rejected_reason"]) ? "" : $params["rejected_reason"], "note" => empty($params["rejected_reason"]) ? "" : $params["rejected_reason"],
]; ];
GoodsOperationRecord::insertRecord($record); GoodsOperationRecord::insertRecord($record);
...@@ -840,7 +840,7 @@ class GoodsService ...@@ -840,7 +840,7 @@ class GoodsService
} }
/** /**
* 通过sku_id 和 version 获取实时商品信息 * 通过sku_id 和 goods_version 获取实时商品信息
* @param $params * @param $params
* @return array * @return array
* @throws GoodsException * @throws GoodsException
...@@ -848,7 +848,7 @@ class GoodsService ...@@ -848,7 +848,7 @@ class GoodsService
public static function getGoodsRealTimeInfo($params) public static function getGoodsRealTimeInfo($params)
{ {
$data = []; $data = [];
$goodsSku = GoodsSku::get("*", ["goods_sku_id" => $params["goods_sku_id"], "version" => $params["version"]]); $goodsSku = GoodsSku::get("*", ["goods_sku_id" => $params["goods_sku_id"], "goods_version" => $params["goods_version"]]);
if (empty($goodsSku)) { if (empty($goodsSku)) {
throw new GoodsException(["cus" => 15]); throw new GoodsException(["cus" => 15]);
} }
...@@ -868,7 +868,7 @@ class GoodsService ...@@ -868,7 +868,7 @@ class GoodsService
public static function getGoodsSnapshotInfo($params) public static function getGoodsSnapshotInfo($params)
{ {
$data = []; $data = [];
$goodsSnapshot = GoodsSnapshot::getRecord(["goods_sku_id" => $params["goods_sku_id"], "version" => $params["version"]]); $goodsSnapshot = GoodsSnapshot::getRecord(["goods_sku_id" => $params["goods_sku_id"], "goods_version" => $params["goods_version"]]);
if (empty($goodsSnapshot)) { if (empty($goodsSnapshot)) {
throw new GoodsException(["cus" => 23]); throw new GoodsException(["cus" => 23]);
} }
...@@ -912,7 +912,7 @@ class GoodsService ...@@ -912,7 +912,7 @@ class GoodsService
public static function checkGoodsMarketing($params) public static function checkGoodsMarketing($params)
{ {
$data = []; $data = [];
$goodsSku = GoodsSku::get("*", ["goods_sku_id" => $params["goods_sku_id"], "version" => $params["version"]]); $goodsSku = GoodsSku::get("*", ["goods_sku_id" => $params["goods_sku_id"], "goods_version" => $params["goods_version"]]);
if (empty($goodsSku)) { if (empty($goodsSku)) {
throw new GoodsException(["cus" => 15]); throw new GoodsException(["cus" => 15]);
} }
......
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