From 1da6fca93ed0d6885950902e18542c4d9e7b0b1b Mon Sep 17 00:00:00 2001 From: vguanyiwgd Date: Wed, 5 Jun 2024 16:05:45 +0800 Subject: [PATCH] update Change-Id: I7ffadcbd1734d9a116aa20e9fb4560fccc622015 --- backstage/system/libraries/Recharge_config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backstage/system/libraries/Recharge_config.php b/backstage/system/libraries/Recharge_config.php index 897df21..6ec7f56 100644 --- a/backstage/system/libraries/Recharge_config.php +++ b/backstage/system/libraries/Recharge_config.php @@ -108,10 +108,10 @@ class CI_Recharge_config { private function get_recharge_count($userId, $gift_type){ 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{ // 每次赠送 - 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; } }