|
@@ -117,7 +117,12 @@ class StoreGoods extends Controller
|
|
|
}
|
|
|
// 添加或编辑商品
|
|
|
if($this->request->isPost() && in_array($this->request->action(),['add','edit'])){
|
|
|
-
|
|
|
+ list($data) = [$this->request->post()];
|
|
|
+ $check_price = true;
|
|
|
+ foreach (json_decode($data['lists'], true) as $vo){
|
|
|
+ if( $vo[0]['sell_price'] <=0 )$check_price = false;
|
|
|
+ }
|
|
|
+ if(!$check_price) $this->error('价格设置有误');
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -259,7 +264,6 @@ class StoreGoods extends Controller
|
|
|
$data['id'] = $result;
|
|
|
$low_price = 0;
|
|
|
foreach (json_decode($data['lists'], true) as $vo){
|
|
|
- if($vo[0]['sell_price'] <= 0) $this->error('商品销售价格需大于0元');
|
|
|
if($low_price == 0 || $vo[0]['sell_price'] < $low_price )$low_price = $vo[0]['sell_price'];
|
|
|
Data::save('StoreGoodsItem', [
|
|
|
'goods_id' => $data['id'],
|