Commit aeb14ba0 authored by luhongguang's avatar luhongguang

update:处理参数没有的报错

parent 1a07dd56
...@@ -181,10 +181,13 @@ class GoodsService ...@@ -181,10 +181,13 @@ class GoodsService
if ($checkGoodsDesc) { if ($checkGoodsDesc) {
throw new GoodsException(['cus' => 20]); throw new GoodsException(['cus' => 20]);
} }
$checkGoodsIntroduce = self::isHaveSensitive($skuData["introduce"], 3); if (!empty($skuData["introduce"])) {
if ($checkGoodsIntroduce) { $checkGoodsIntroduce = self::isHaveSensitive($skuData["introduce"], 3);
throw new GoodsException(['cus' => 21]); if ($checkGoodsIntroduce) {
throw new GoodsException(['cus' => 21]);
}
} }
$checkGoodsRuleDesc = self::isHaveSensitive($skuData["rule_desc"], 2); $checkGoodsRuleDesc = self::isHaveSensitive($skuData["rule_desc"], 2);
if ($checkGoodsRuleDesc) { if ($checkGoodsRuleDesc) {
throw new GoodsException(['cus' => 22]); throw new GoodsException(['cus' => 22]);
...@@ -1203,7 +1206,7 @@ class GoodsService ...@@ -1203,7 +1206,7 @@ class GoodsService
} }
$info = GoodsSku::getRecord($where); $info = GoodsSku::getRecord($where);
$info['original_price'] = $info['original_price']/100; $info['original_price'] = empty($info['original_price']) ? 0 : $info['original_price']/100;
$info['price'] = $info['price']/100; $info['price'] = $info['price']/100;
$info['desc_pic_url'] = self::getUrlList($info['desc_pic_url']); $info['desc_pic_url'] = self::getUrlList($info['desc_pic_url']);
$info['introduce_pic_url'] = self::getUrlList($info['introduce_pic_url']); $info['introduce_pic_url'] = self::getUrlList($info['introduce_pic_url']);
......
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