Commit f9538243 authored by luhongguang's avatar luhongguang

update:商品库存为0不能上架和审核通过

parent 60101c58
......@@ -358,7 +358,7 @@ class GoodsService
if ($status == GoodsSku::STATUS_PASS && $sku["expiration_time"] < date("Y-m-d H:i:s")) {
throw new GoodsException(["cus" => 30]);
}
if ($sku["inventory_rest"] <= 0) {
if ($status == GoodsSku::STATUS_PASS && $sku["inventory_rest"] <= 0) {
throw new GoodsException(["cus" => 24]);
}
$goodsSkuId = $sku["goods_sku_id"];
......@@ -446,7 +446,7 @@ class GoodsService
if ($onlineStatus == GoodsSku::ONLINE_STATUS_ONLINE && $sku["expiration_time"] < date("Y-m-d H:i:s")) {
throw new GoodsException(["cus" => 30]);
}
if ($sku["inventory_rest"] <= 0) {
if ($onlineStatus == GoodsSku::ONLINE_STATUS_ONLINE && $sku["inventory_rest"] <= 0) {
throw new GoodsException(["cus" => 24]);
}
$goodsSkuId = $sku["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