|
@@ -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('您已领取过该优惠劵');
|