|
@@ -198,10 +198,6 @@ class Buy extends Core
|
|
|
|
|
|
public function coupon($price, $method, $type = 1)
|
|
|
{
|
|
|
- if ($price <= 0) {
|
|
|
- Dever::alert('付款价格错误');
|
|
|
- }
|
|
|
-
|
|
|
$user_coupon_id = Dever::input('user_coupon_id');
|
|
|
|
|
|
$this->data['user_coupon_id'] = 0;
|
|
@@ -209,6 +205,9 @@ class Buy extends Core
|
|
|
$this->data['coupon_cash'] = 0;
|
|
|
|
|
|
if ($type == 1) {
|
|
|
+ if ($price <= 0) {
|
|
|
+ Dever::alert('付款价格错误');
|
|
|
+ }
|
|
|
|
|
|
$coupon = Dever::db('shop/user_coupon')->getAll(array('uid' => $this->uid, 'city' => $this->shop['city'], 'status' => 1, 'edate' => time()));
|
|
|
|
|
@@ -251,6 +250,9 @@ class Buy extends Core
|
|
|
}
|
|
|
|
|
|
if ($user_coupon_id) {
|
|
|
+ if ($price <= 0) {
|
|
|
+ Dever::alert('付款价格错误');
|
|
|
+ }
|
|
|
$coupon = Dever::db('shop/user_coupon')->find(array('uid' => $this->uid, 'id' => $user_coupon_id, 'status' => 1));
|
|
|
if (!$coupon) {
|
|
|
Dever::alert('优惠券不可用');
|