|
@@ -102,7 +102,7 @@ class Coupon extends Apic
|
|
|
'id' => $id,
|
|
|
'remain' => ['gt',0],
|
|
|
];
|
|
|
- $check = Db::name('user_coupons')->field('id,coupon_name,coupon_info,endtime,getfrom')->where($map)->find();
|
|
|
+ $check = Db::name('user_coupons')->field('id,coupon_name as name,endtime,getfrom')->where($map)->find();
|
|
|
if(!empty($check)){
|
|
|
$check['action'] = $action;
|
|
|
}
|
|
@@ -113,11 +113,16 @@ class Coupon extends Apic
|
|
|
'ordertype' => 3,
|
|
|
'status' => 2,
|
|
|
];
|
|
|
- $check = Db::name('order')->field('id,package_info,package_price')->where($map)->find();
|
|
|
+ $check = Db::name('order')->field('id,package_title as name,package_endtime as endtime,package_price as price')->where($map)->find();
|
|
|
if(!empty($check)){
|
|
|
+ $check['getfrom'] = '购买';
|
|
|
$check['action'] = $action;
|
|
|
}
|
|
|
}
|
|
|
+ if(empty($check))
|
|
|
+ {
|
|
|
+ $this->error('错误的核销码');
|
|
|
+ }
|
|
|
|
|
|
$this->success(1,$check);
|
|
|
}
|