|
@@ -292,6 +292,7 @@ class Goods extends Backend
|
|
$this->validate($data=input('row/a'),[
|
|
$this->validate($data=input('row/a'),[
|
|
'buy_type'=>['require','in:0,1,2'],
|
|
'buy_type'=>['require','in:0,1,2'],
|
|
'buy_before_time|提前购买时间'=>['requireIf:buy_type,1'],
|
|
'buy_before_time|提前购买时间'=>['requireIf:buy_type,1'],
|
|
|
|
+ 'buy_before_user_limit|提前购买限制数量'=>['requireIf:buy_type,1','integer','egt:0'],
|
|
]);
|
|
]);
|
|
if($data['buy_type']!=0){
|
|
if($data['buy_type']!=0){
|
|
$this->validate($data,[
|
|
$this->validate($data,[
|
|
@@ -303,6 +304,7 @@ class Goods extends Backend
|
|
$this->error($e->getMessage());
|
|
$this->error($e->getMessage());
|
|
}
|
|
}
|
|
$row['buy_type']=$data['buy_type'];
|
|
$row['buy_type']=$data['buy_type'];
|
|
|
|
+ $row['buy_before_user_limit']=$data['buy_before_user_limit'];
|
|
$row['buy_before_time']=$data['buy_before_time'];
|
|
$row['buy_before_time']=$data['buy_before_time'];
|
|
$row->save();
|
|
$row->save();
|
|
$buy=$row->buy()->where('source_goods_id',$data['source_goods_id'])->find();
|
|
$buy=$row->buy()->where('source_goods_id',$data['source_goods_id'])->find();
|