|
@@ -104,7 +104,7 @@ class Coupon extends Apic
|
|
|
];
|
|
|
$check = Db::name('user_coupons')->field('id,coupon_name,coupon_info,endtime,getfrom')->where($map)->find();
|
|
|
if(!empty($check)){
|
|
|
- $check['action'] = 'hexiaocoupon';
|
|
|
+ $check['action'] = $action;
|
|
|
}
|
|
|
}else{
|
|
|
$map = [
|
|
@@ -115,13 +115,11 @@ class Coupon extends Apic
|
|
|
];
|
|
|
$check = Db::name('order')->field('id,package_info,package_price')->where($map)->find();
|
|
|
if(!empty($check)){
|
|
|
- $check['action'] = 'hexiaoorder';
|
|
|
+ $check['action'] = $action;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->success(1,$check);
|
|
|
-
|
|
|
- //$this->$action($id);
|
|
|
}
|
|
|
|
|
|
//统一核销
|
|
@@ -206,7 +204,7 @@ class Coupon extends Apic
|
|
|
}
|
|
|
|
|
|
//数量减一
|
|
|
- $rs = Db::name('order')->where($map)->update(['status'=>3,'hexiaotime'=>time()]);
|
|
|
+ $rs = Db::name('order')->where($map)->update(['status'=>3,'hexiaotime'=>time(),'finishtime'=>time()]);
|
|
|
if($rs === false){
|
|
|
Db::rollback();
|
|
|
$this->error('核销失败');
|