Change-Id: I7ffadcbd1734d9a116aa20e9fb4560fccc622015
This commit is contained in:
vguanyiwgd 2024-06-05 16:05:45 +08:00
parent 49521eae27
commit 1da6fca93e
1 changed files with 2 additions and 2 deletions

View File

@ -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;
} }
} }