|
@@ -83,11 +83,15 @@ Class Home extends Core
|
|
|
}
|
|
|
$this->data['user']['content'] = '';
|
|
|
if ($uid && $uid > 0) {
|
|
|
- if ($this->data['info']['status']!=5){
|
|
|
+ if (time() < $this->data['info']['act_end']){
|
|
|
$count = Dever::db('active/order')->getNum(array('active_id'=>$this->data['info']['id'],'uid'=>$uid,'status'=>'1,2,4,5'));
|
|
|
- $code = Dever::db('active/code')->state(array('active_id'=>$this->data['info']['id'],'buy_uid'=>$uid,'status'=>'1,2'));
|
|
|
+ $code = Dever::db('active/code')->getNum(array('active_id'=>$this->data['info']['id'],'buy_uid'=>$uid,'status'=>'1,2'));
|
|
|
if ($count['total'] && $count['total'] > 0){
|
|
|
+
|
|
|
$no_num = $count['total'] - $code;
|
|
|
+ if ($no_num < 0) {
|
|
|
+ $no_num = 0;
|
|
|
+ }
|
|
|
$this->data['user']['content'] = '已购核销码'.$count['total'].'张,未使用'.$no_num.'张';
|
|
|
}
|
|
|
}
|