Commit c9c3365c authored by luhongguang's avatar luhongguang

update:编辑商品时候判断上架状态

parent 53137dad
...@@ -39,5 +39,6 @@ class GoodsException extends BaseException ...@@ -39,5 +39,6 @@ class GoodsException extends BaseException
25 => '开始时间格式不对', 25 => '开始时间格式不对',
26 => '结束时间格式不对', 26 => '结束时间格式不对',
27 => 'TCC调用失败', 27 => 'TCC调用失败',
28 => '上架状态不能编辑,需先下架,再做编辑操作',
]; ];
} }
\ No newline at end of file
...@@ -529,6 +529,10 @@ class GoodsService ...@@ -529,6 +529,10 @@ class GoodsService
*/ */
private static function editGoodsSku($goodsSkuId, $skuData, $params = []) private static function editGoodsSku($goodsSkuId, $skuData, $params = [])
{ {
$skuInfo = GoodsSku::getRecord(["goods_sku_id" => $goodsSkuId]);
if ($skuInfo["online_status"] == GoodsSku::ONLINE_STATUS_ONLINE) {
throw new GoodsException(['cus' => 28]);
}
if ($params["expiration_time"] < date("Y-m-d H:i:s")) { if ($params["expiration_time"] < date("Y-m-d H:i:s")) {
throw new GoodsException(['cus' => 16]); throw new GoodsException(['cus' => 16]);
} }
......
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