dever il y a 3 ans
Parent
commit
aecd319bda
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      app/shop/lib/Coupon.php

+ 3 - 3
app/shop/lib/Coupon.php

@@ -74,9 +74,9 @@ class Coupon
         }
 
         if ($act) {
-            $data = Dever::db('shop/coupon_act')->getOne(array('shop_id' => $shop['id'], 'act_id' => $act_id, 'shop_coupon_id' => $shop_coupon_id));
+            $act = Dever::db('shop/coupon_act')->getOne(array('shop_id' => $shop['id'], 'act_id' => $act_id, 'shop_coupon_id' => $shop_coupon_id));
 
-            if (!$data) {
+            if (!$act) {
                 Dever::alert('优惠券不存在');
                 return false;
             }
@@ -88,7 +88,7 @@ class Coupon
             }
 
             # 验证是否已经领取,一周内不能再次领取
-            $user = Dever::db('shop/user_coupon')->getOne(array('uid' => $uid, 'shop_coupon_id' => $data['id']));
+            $user = Dever::db('shop/user_coupon')->getOne(array('uid' => $uid, 'shop_coupon_id' => $shop_coupon_id));
 
             if ($user && time() - $user['cdate'] < 86400*7) {
                 Dever::alert('您已领取过该优惠劵');