|
@@ -144,9 +144,6 @@ class Mobile extends Model
|
|
|
if(isset($mobile['amount_di']) && isset($mobile['amount_base']) && $mobile['amount_di']>$mobile['amount_base']){
|
|
|
throw_user('底价不能大于售价');
|
|
|
}
|
|
|
- if(isset($mobile['amount_di']) && isset($mobile['amount_kill']) && $mobile['amount_di']>$mobile['amount_kill']){
|
|
|
- throw_user('底价不能大于秒杀价');
|
|
|
- }
|
|
|
});
|
|
|
self::beforeUpdate(function (self $mobile){
|
|
|
$data=$mobile->getChangedData();
|
|
@@ -173,6 +170,9 @@ class Mobile extends Model
|
|
|
$mobile->makeSort();
|
|
|
}
|
|
|
$mobile->makeSortLine();
|
|
|
+ if($mobile['is_activity'] && $mobile['amount_di']>$mobile['amount_kill']){
|
|
|
+ throw_user('底价不能大于秒杀价');
|
|
|
+ }
|
|
|
});
|
|
|
self::beforeInsert(function (self $mobile){
|
|
|
$mobile['sort']=self::max('sort')+1;
|