hrjy 3 years ago
parent
commit
f19bd4762c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      app/api/controller/user/UserController.php

+ 2 - 0
app/api/controller/user/UserController.php

@@ -695,7 +695,9 @@ class UserController
         if ($coupon['status'] == 1) return app('json')->fail('优惠券已使用');
         if ($coupon['status'] == 1) return app('json')->fail('优惠券已使用');
         if ($coupon['status'] == 2) return app('json')->fail('优惠券已过期');
         if ($coupon['status'] == 2) return app('json')->fail('优惠券已过期');
         if ($coupon['uid'] == $request->uid()) return app('json')->fail('自己不能领取自己的优惠券');
         if ($coupon['uid'] == $request->uid()) return app('json')->fail('自己不能领取自己的优惠券');
+        if ($coupon['share_status'] == 1) return app('json')->fail('优惠券已分享');
         $coupon['uid'] = $request->uid();
         $coupon['uid'] = $request->uid();
+        $coupon['share_status'] = 1;
         $order = StoreOrder::where('order_id', $coupon['order_id'])->find();
         $order = StoreOrder::where('order_id', $coupon['order_id'])->find();
         if ($order['use'] < 1){
         if ($order['use'] < 1){
             $order_coupon = StoreCouponUser::where('order_id', $coupon['order_id'])->where('uid', $order['uid'])->where('code', '<>', $data['code'])->where('status', '<', 1)->count();
             $order_coupon = StoreCouponUser::where('order_id', $coupon['order_id'])->where('uid', $order['uid'])->where('code', '<>', $data['code'])->where('status', '<', 1)->count();