|
@@ -242,11 +242,11 @@ class Product extends Auth{
|
|
|
// 循环处理
|
|
|
foreach ($skuList as $attrNames => $value) {
|
|
|
// SKU限购,所以限购时间也必须填
|
|
|
- if( $value['quota'] && ( !$data['quota_start'] || !$data['quota_end'] )) return json_send(['code'=>'error','msg'=>'SKU限购时,请填限购时间','data'=>['error'=>'SKU限购时,请填限购时间']]);
|
|
|
+ if( $value['quota'] && ( !$data['quota_start'] || !$data['quota_end'] )) return json_send(['code'=>'error','msg'=>'SKU限购时,请填限购时间','data'=>['error'=>'SKU限购时,请填限购时间']]);
|
|
|
// 限购提示
|
|
|
- if( $value['min_quota'] > $value['quota'] ) return json_send(['code'=>'error','msg'=>$attrNames.'起购数量请勿大于限购数量','data'=>['error'=>$attrNames.'起购数量请勿大于限购数量']]);
|
|
|
+ if( $value['min_quota'] && $value['min_quota'] > $value['quota'] ) return json_send(['code'=>'error','msg'=>$attrNames.'起购数量请勿大于限购数量','data'=>['error'=>$attrNames.'起购数量请勿大于限购数量']]);
|
|
|
// 提示起购数量异常,如果总起购数量小于SKU起购数量,提示
|
|
|
- if( $data['min_quota'] && $value['min_quota'] < $data['min_quota'] ) return json_send(['code'=>'error','msg'=>'SKU的起购数量不能小于总起购数量','data'=>['error'=>'SKU的起购数量不能小于总起购数量']]);
|
|
|
+ if( $data['min_quota'] && $value['min_quota'] < $data['min_quota'] ) return json_send(['code'=>'error','msg'=>'SKU的起购数量不能小于总起购数量','data'=>['error'=>'SKU的起购数量不能小于总起购数量']]);
|
|
|
}
|
|
|
// 限购数量
|
|
|
$quota = array_sum(array_column($skuList,'quota'));
|
|
@@ -465,7 +465,7 @@ class Product extends Auth{
|
|
|
// SKU限购,所以限购时间也必须填
|
|
|
if( $value['quota'] && ( !$data['quota_start'] || !$data['quota_end'] )) return json_send(['code'=>'error','msg'=>'SKU限购时,请填限购时间','data'=>['error'=>'SKU限购时,请填限购时间']]);
|
|
|
// 限购提示
|
|
|
- if( $value['min_quota'] > $value['quota'] ) return json_send(['code'=>'error','msg'=>$attrNames.'起购数量请勿大于限购数量','data'=>['error'=>$attrNames.'起购数量请勿大于限购数量']]);
|
|
|
+ if( $value['min_quota'] && $value['min_quota'] > $value['quota'] ) return json_send(['code'=>'error','msg'=>$attrNames.'起购数量请勿大于限购数量','data'=>['error'=>$attrNames.'起购数量请勿大于限购数量']]);
|
|
|
// 提示起购数量异常,如果总起购数量小于SKU起购数量,提示
|
|
|
if( $data['min_quota'] && $value['min_quota'] < $data['min_quota'] ) return json_send(['code'=>'error','msg'=>'SKU的起购数量不能小于总起购数量','data'=>['error'=>'SKU的起购数量不能小于总起购数量']]);
|
|
|
}
|
|
@@ -717,7 +717,7 @@ class Product extends Auth{
|
|
|
// SKU限购,所以限购时间也必须填
|
|
|
if( $value['quota'] && ( !$data['quota_start'] || !$data['quota_end'] )) return json_send(['code'=>'error','msg'=>'SKU限购时,请填限购时间','data'=>['error'=>'SKU限购时,请填限购时间']]);
|
|
|
// 限购提示
|
|
|
- if( $value['min_quota'] > $value['quota'] ) return json_send(['code'=>'error','msg'=>$attrNames.'起购数量请勿大于限购数量','data'=>['error'=>$attrNames.'起购数量请勿大于限购数量']]);
|
|
|
+ if( $value['min_quota'] && $value['min_quota'] > $value['quota'] ) return json_send(['code'=>'error','msg'=>$attrNames.'起购数量请勿大于限购数量','data'=>['error'=>$attrNames.'起购数量请勿大于限购数量']]);
|
|
|
// 提示起购数量异常,如果总起购数量小于SKU起购数量,提示
|
|
|
if( $data['min_quota'] && $value['min_quota'] < $data['min_quota'] ) return json_send(['code'=>'error','msg'=>'SKU的起购数量不能小于总起购数量','data'=>['error'=>'SKU的起购数量不能小于总起购数量']]);
|
|
|
}
|