This commit is contained in:
2022-06-01 20:57:49 -04:00
parent 9ea25c81c4
commit a9380d73e9
3 changed files with 60 additions and 3 deletions
+9 -1
View File
@@ -9,8 +9,16 @@ function __construct() {
public function loadMemberActiveCoupons($member_id,$fliters=[]){
$sql="SELECT id, ca.code, ca.amount, ca.added::date,ca.status
FROM coupons_allocation ca WHERE ca.member_id = $member_id ORDER BY ca.id DESC";
FROM coupons_allocation ca WHERE ca.member_id = $member_id AND ca.active IS NULL ORDER BY ca.id DESC";
$q = $this->db->query($sql);
return $q;
}
public function loadMemberRedeemCoupons($member_id,$fliters=[]){
$sql="SELECT id, ca.code, ca.amount, ca.added::date,ca.status ,ca.active
FROM coupons_allocation ca WHERE ca.member_id = $member_id AND ca.active IS NOT NULL ORDER BY ca.id DESC";
$q = $this->db->query($sql);
return $q;
}
}