Dashboard Fixes : ps
This commit is contained in:
parent
0209906651
commit
52e744b5bc
@ -59,14 +59,13 @@ class HomeModel extends Model
|
||||
|
||||
public function expiring_membership_list(){
|
||||
$now = date('Y-m-d');
|
||||
$last30days = date('Y-m-d', strtotime('+30 days'));
|
||||
|
||||
$last30days = date('Y-m-d', strtotime('+30 days'));
|
||||
return $this->db->table('subscription as S')
|
||||
->join('customers as C', 'C.customer_id = S.customer_id', 'left')
|
||||
->join('category as CM', 'CM.id = S.scheme_id', 'left')
|
||||
->join('book_categories as BC', 'BC.category_id = S.scheme_id', 'left')
|
||||
->join('books as BK', 'BC.book_id = BK.book_id', 'left')
|
||||
->select('CM.name, CONCAT(C.first_name, " ", C.last_name) as customer_name, C.email as customer_email, C.mobile_no as customer_mobile, S.sub_id, S.scheme_id, S.customer_id, S.from_subscription, S.to_subscription, S.business_id, S.to_subscription, S.from_subscription, BK.title, BK.book_id,DATEDIFF(S.to_subscription, CURDATE()) as countdays')
|
||||
->join('books as BK', 'BK.book_id = S.scheme_id', 'left')
|
||||
->join('book_categories as BC', 'BC.book_id = S.scheme_id', 'left')
|
||||
->join('category as CM', 'CM.id = BC.category_id', 'left')
|
||||
->select('CM.name, CONCAT(C.first_name, " ", C.last_name) as customer_name, C.email as customer_email, C.mobile_no as customer_mobile, S.sub_id, S.scheme_id, S.customer_id, S.business_id, S.to_subscription, S.from_subscription, BK.title, BK.book_id,DATEDIFF(S.to_subscription, CURDATE()) as countdays')
|
||||
->where('S.to_subscription >=', $now)
|
||||
->where('S.to_subscription <=', $last30days)
|
||||
// ->where('BC.category_id', 5)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user