update
Change-Id: I7ffadcbd1734d9a116aa20e9fb4560fccc622015
This commit is contained in:
parent
49521eae27
commit
1da6fca93e
|
@ -108,10 +108,10 @@ class CI_Recharge_config {
|
||||||
private function get_recharge_count($userId, $gift_type){
|
private function get_recharge_count($userId, $gift_type){
|
||||||
if($gift_type == 1){
|
if($gift_type == 1){
|
||||||
// 每年赠送
|
// 每年赠送
|
||||||
return $this->CI->db->query("select count(id) as num from tb_recharge where user_id=? and type=1 and YEAR(record_datetime) = YEAR(CURDATE())", array($userId))->row()->num;
|
return $this->CI->db->query("select count(a.id) as num from tb_recharge a, tb_account b where a.account_id=b.id and b.type_id=2 and a.user_id=? and a.type=1 and YEAR(record_datetime) = YEAR(CURDATE())", array($userId))->row()->num;
|
||||||
}else{
|
}else{
|
||||||
// 每次赠送
|
// 每次赠送
|
||||||
return $this->CI->db->query("select count(id) as num from tb_recharge where user_id=? and type=1", array($userId))->row()->num;
|
return $this->CI->db->query("select count(a.id) as num from tb_recharge a, tb_account b where a.account_id=b.id and b.type_id=2 and a.user_id=? and a.type=1", array($userId))->row()->num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue