Files
WrenchBoradWeb/www/application/models/Report_model.php
T
2022-06-04 22:20:25 -04:00

37 lines
1.2 KiB
PHP

<?php
class Report_model extends CI_Model {
function __construct() {
}
public function getCardPurchase($limit){
$data = array();
$mysql = "SELECT added::date,"
." (CASE WHEN code ='MNCCD' THEN 'New Card Payment' "
. "WHEN code ='MRCCD' THEN 'Repeat Card Payment' "
. "ELSE '' END) AS Description,amount*0.01 AS amount,fee*0.01 as fee,confirmation "
. "FROM members_payments "
. "WHERE member_id = " . $_SESSION['member_id'] . " AND status = 1 ORDER BY id DESC LIMIT ". $limit; // OFFSET " . $page;
$query = $this->db->query($mysql);
$data['card_payment_data_result'] = $query->result();
return $data;
}
public function getRedeemCouponsList($limit){
$data = array();
$mysql = "SELECT id,code,amount,active::date ,added::date
FROM coupons_allocation
WHERE member_id =" . $_SESSION['member_id'] . " AND
active IS NOT NULL ORDER BY active DESC LIMIT ". $limit;
$query = $this->db->query($mysql);
$data['card_coupon_data_result'] = $query->result();
return $data;
}
}