|
@@ -143,6 +143,10 @@ class CouponActivity extends Controller
|
|
|
}
|
|
|
if($this->request->isPost()) {
|
|
|
$select_coupon = [];
|
|
|
+ if(empty($data['coupon'])) $this->error('请选择优惠券');
|
|
|
+ if(empty($data['start_time'])) $this->error('请选择活动开始时间');
|
|
|
+ if(empty($data['end_time'])) $this->error('请选择活动结束时间');
|
|
|
+ if(strtotime($data['start_time']) >= strtotime($data['end_time'])) $this->error('请选择活动时间有误');
|
|
|
if(isset($data['coupon']) && !empty($data['coupon'])){
|
|
|
foreach ($data['coupon'] as $key=>$value){
|
|
|
if($value) $select_coupon[] = $key;
|
|
@@ -150,7 +154,6 @@ class CouponActivity extends Controller
|
|
|
}
|
|
|
$data['coupon_set'] = '|'.implode('|',$select_coupon).'|';
|
|
|
}
|
|
|
-
|
|
|
if($this->request->isGet() && $this->request->action() =='edit') {
|
|
|
$this->coupon_arr = isset($data['coupon_set']) ? explode('|',trim($data['coupon_set'],'|')) : [];
|
|
|
}
|