From aca26c6361cfa437224779932f66f583eaeef044 Mon Sep 17 00:00:00 2001 From: sriramv Date: Fri, 28 Dec 2018 14:29:18 +0530 Subject: [PATCH] dashboard issue --- Apollo/api/application/config/database.php | 16 ++++++++++------ .../api/application/models/Dashboard_model.php | 13 +++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Apollo/api/application/config/database.php b/Apollo/api/application/config/database.php index 076996e4..d5f21239 100755 --- a/Apollo/api/application/config/database.php +++ b/Apollo/api/application/config/database.php @@ -76,13 +76,17 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'apollodec.com', - 'username' => 'apollod4_DEV', - 'password' => 'apollo1234', - 'database' => 'apollod4_ApolloDECDev', + 'username' => 'apollod4_DEV', + 'password' => 'apollo1234', + 'database' => 'apollod4_ApolloDECDev', - // 'username' => 'apollod4_SIT', - // 'password' => 'apollosit1234', - // 'database' => 'apollod4_ApolloDECNEWSIT', + // 'username' => 'apollod4_SIT', + // 'password' => 'apollosit1234', + // 'database' => 'apollod4_ApolloDECNEWSIT', + + // 'username' => 'apollod4_PROD', + // 'password' => 'approd!2017', + // 'database' =>'apollod4_ApolloDECNEWPROD', 'dbdriver' => 'mysqli', 'dbprefix' => '', diff --git a/Apollo/api/application/models/Dashboard_model.php b/Apollo/api/application/models/Dashboard_model.php index 11081413..aee3a37b 100755 --- a/Apollo/api/application/models/Dashboard_model.php +++ b/Apollo/api/application/models/Dashboard_model.php @@ -401,7 +401,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){ left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus join T_PickListDetails list on list.ListCode=ltf.StatusName where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) - and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' "; + and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.StatusName ='S020' "; $followupsCount=$this->db->query($sql); $fcount = $followupsCount->result(); $ssql = "select count(ltf.TrackingID) as count @@ -413,9 +413,10 @@ public function leadCountMonth($branchId = null, $requestedBy = null){ left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus join T_PickListDetails list on list.ListCode=ltf.StatusName where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) - and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' "; + and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' and ltf.StatusName ='S020' "; $sfollowupsCount=$this->db->query($ssql); $sfcount = $sfollowupsCount->result(); + //print_r($sql);die(); if (count($fcount) > 0) { $results['fUpList'] = true; $results['fUp_data'] = $fcount; @@ -437,7 +438,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){ left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus join T_PickListDetails list on list.ListCode=ltf.StatusName where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) - and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' "; + and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.StatusName ='S020'"; $followupsCount=$this->db->query($sql); $fcount = $followupsCount->result(); //to staff ltf.StatusName ='S020' @@ -453,7 +454,7 @@ public function leadCountMonth($branchId = null, $requestedBy = null){ and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and ltf.IsActive = 1 and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' "; $sfollowupsCount=$this->db->query($ssql); - //print_r($sql);die(); +//print_r($sql);die(); $sfcount = $sfollowupsCount->result(); if (count($fcount) > 0) { @@ -819,7 +820,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus join T_PickListDetails list on list.ListCode=ltf.StatusName where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) - and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and lt.CreatedBranch = '".$branchId."' "; + and STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y') = date(now()) and lt.CreatedBranch = '".$branchId."' and ltf.StatusName ='S020'"; $ltd=$this->db->query($sql); $tlead = $ltd->result(); //to staff @@ -857,7 +858,7 @@ $sql="select sum(TotalBalance) as total FROM (select (sum(totalpayable) - sum(to left join T_ActivityMaster am on am.ActivityID=lt.ActivityStatus join T_PickListDetails list on list.ListCode=ltf.StatusName where InteractionID in (select max(InteractionID) from T_Lead_Tracking_Followup group by TrackingID) - and list.ListName not like 'CLOSE' and list.ListName like 'PENDING' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and lt.CreatedBranch = '".$branchId."' "; + and list.ListName not like 'CLOSE' and list.ListName like 'PENDING' and month(STR_TO_DATE(ltf.FollowupOn,'%d-%m-%Y')) = month(now()) and lt.CreatedBranch = '".$branchId."' and ltf.StatusName ='S020' "; $ltd=$this->db->query($sql); $tlead = $ltd->result(); //To staff