diff --git a/app/Models/HomeModel.php b/app/Models/HomeModel.php index c00cdca7..affa89d1 100644 --- a/app/Models/HomeModel.php +++ b/app/Models/HomeModel.php @@ -61,7 +61,9 @@ class HomeModel extends Model { $query = $this->db->table('subscription AS S') ->select('S.business_id,BK.title as name,BK.book_id as id,S.scheme_id,LEFT(BK.title, 1) AS first_letter,COUNT(S.customer_id) AS count,BI.wp_img_url') - ->select('COUNT(S.customer_id) AS overall,COUNT(IF(S.isactive = 0, S.customer_id, NULL)) AS nonrenewal,COUNT(IF(S.isactive = 1, S.customer_id, NULL)) AS renewal') + //->select('COUNT(S.customer_id) AS overall,COUNT(IF(S.isactive = 0, S.customer_id, NULL)) AS nonrenewal,COUNT(IF(S.isactive = 1, S.customer_id, NULL)) AS renewal') + //->select('COUNT(IF(S.isactive = 1, S.customer_id, NULL)) AS overall,COUNT(IF(S.is_renew = 0 AND S.isactive = 1, S.customer_id, NULL)) AS nonrenewal,COUNT(IF(S.is_renew = 1 AND S.isactive = 1, S.customer_id, NULL)) AS renewal') + ->select('COUNT(S.customer_id) AS overall,COUNT(IF(S.isactive = 1, S.customer_id, NULL)) AS activeoverall,COUNT(IF(S.is_renew = 0 AND S.isactive = 1, S.customer_id, NULL)) AS nonrenewal,COUNT(IF(S.is_renew = 1 AND S.isactive = 1, S.customer_id, NULL)) AS renewal') ->join('customers AS C', 'C.customer_id = S.customer_id AND C.isactive = 1', 'left') ->join('books AS BK', 'BK.book_id = S.scheme_id', 'left') ->join('book_categories AS BC', 'BC.book_id = S.scheme_id AND BC.isactive = 1', 'left') diff --git a/app/Views/dashboard.php b/app/Views/dashboard.php index 1d2ef1da..7cf33fb7 100644 --- a/app/Views/dashboard.php +++ b/app/Views/dashboard.php @@ -159,7 +159,7 @@

Members - OverAll

-

+

Members - Renewal