Commit 4ef66d47 authored by jianghaiming's avatar jianghaiming

Merge branch 'test' of https://gitlab.yidian-inc.com/bp/goods into test

parents 8a286985 a404e30f
......@@ -358,6 +358,9 @@ class GoodsService
if ($status == GoodsSku::STATUS_PASS && $sku["expiration_time"] < date("Y-m-d H:i:s")) {
throw new GoodsException(["cus" => 30]);
}
if ($status == GoodsSku::STATUS_PASS && $sku["inventory_rest"] <= 0) {
throw new GoodsException(["cus" => 24]);
}
$goodsSkuId = $sku["goods_sku_id"];
$rejectedReason = strlen(trim($params["rejected_reason"])) == 0 ? "" : $params["rejected_reason"];
......@@ -440,6 +443,12 @@ class GoodsService
if ($sku["audit_status"] != GoodsSku::STATUS_PASS) {
throw new GoodsException(["cus" => 14]);
}
if ($onlineStatus == GoodsSku::ONLINE_STATUS_ONLINE && $sku["expiration_time"] < date("Y-m-d H:i:s")) {
throw new GoodsException(["cus" => 30]);
}
if ($onlineStatus == GoodsSku::ONLINE_STATUS_ONLINE && $sku["inventory_rest"] <= 0) {
throw new GoodsException(["cus" => 24]);
}
$goodsSkuId = $sku["goods_sku_id"];
GoodsSku::save(["online_status" => $onlineStatus], ["goods_sku_id" => $goodsSkuId]);
......
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