|
@@ -45,7 +45,7 @@ class Active
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- $order = Dever::db('active/order')->getNum(array('uid'=>$uid,'active_id'=>$active_id));
|
|
|
+ $order = Dever::db('active/order')->getNum(array('uid'=>$uid,'active_id'=>$active_id,'status' => '2,4,5'));
|
|
|
$member = Dever::load('active/lib/user')->agent($user);
|
|
|
if ($data['status'] == 2) {
|
|
|
|
|
@@ -66,10 +66,11 @@ class Active
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- if ($order && $order['total'] && $order['total'] >= $data['num']) {
|
|
|
- Dever::alert('您已超过限购数量');
|
|
|
- }
|
|
|
- if ($num > $data['num'] ) {
|
|
|
+ if ($order) {
|
|
|
+ if ($order['total'] && ($order['total'] + $num) > $data['num']) {
|
|
|
+ Dever::alert('您已超过限购数量');
|
|
|
+ }
|
|
|
+ } elseif ($num > $data['num'] ) {
|
|
|
Dever::alert('您已超过限购数量');
|
|
|
}
|
|
|
}
|