Commit d1d78896 authored by luhongguang's avatar luhongguang

update:过期商品不能上架

parent 57af3f71
...@@ -440,6 +440,9 @@ class GoodsService ...@@ -440,6 +440,9 @@ class GoodsService
if ($sku["audit_status"] != GoodsSku::STATUS_PASS) { if ($sku["audit_status"] != GoodsSku::STATUS_PASS) {
throw new GoodsException(["cus" => 14]); 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]);
}
$goodsSkuId = $sku["goods_sku_id"]; $goodsSkuId = $sku["goods_sku_id"];
GoodsSku::save(["online_status" => $onlineStatus], ["goods_sku_id" => $goodsSkuId]); 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