This commit is contained in:
2022-03-07 14:00:31 -05:00
parent f64576f3e8
commit b0747071e9
10 changed files with 95 additions and 285 deletions
+5 -1
View File
@@ -9,7 +9,11 @@ class Account_model extends CI_Model {
public function getUserWallet($member_id,$currency='') {
$num = 0;
//$mysql = "SELECT * FROM members_wallet WHERE member_id = $member_id AND currency='".$currency."' ";
$mysql = "SELECT w.amount,c.* FROM members_wallet w LEFT JOIN currency c ON c.code=w.currency WHERE w.member_id = $member_id ORDER BY c.lorder DESC";
$and_part = '';
if ($currency =''){
$and_part = " AND w.currency='$currency' ";
}
$mysql = "SELECT w.amount,c.*,w.amount AS current_balance FROM members_wallet w LEFT JOIN currency c ON c.code=w.currency WHERE w.member_id = $member_id ".$and_part." ORDER BY c.lorder DESC";
$query = $this->db->query($mysql);
return $query->result_array();
}