lizhen_gitee 1 tahun lalu
induk
melakukan
b411e0fdb6
1 mengubah file dengan 3 tambahan dan 5 penghapusan
  1. 3 5
      application/api/controller/company/Coupon.php

+ 3 - 5
application/api/controller/company/Coupon.php

@@ -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('核销失败');