dever 3 年之前
父节点
当前提交
aecd319bda
共有 1 个文件被更改,包括 3 次插入3 次删除
  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('您已领取过该优惠劵');