Преглед изворни кода

Merge branch 'master' of ssh://git.dever.cc:10022/dever-product/churen

rabin пре 3 година
родитељ
комит
36b168d1dd
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      learn/active/src/Home.php

+ 6 - 2
learn/active/src/Home.php

@@ -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.'张';
 				}
 			}