dashboard closed count changes

This commit is contained in:
rajasekar 2019-03-12 11:31:33 +05:30
parent 3f7250998e
commit 1aa8ff87ae

View File

@ -295,7 +295,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 date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
and date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSED' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
$ltCount=$this->db->query($ltsql);
$lcount = $ltCount->result();
$sltsql = "select count(InteractionID) as count
@ -307,7 +307,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 date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
and date(ltf.CreatedOn) = date(now()) and list.ListName like 'CLOSED' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
$sltCount=$this->db->query($sltsql);
$slcount = $sltCount->result();
@ -332,7 +332,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(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
and month(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSED' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' ";
$ltCount=$this->db->query($ltsql);
$lcount = $ltCount->result();
$sltsql = "select count(InteractionID) as count
@ -344,7 +344,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(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSE' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
and month(ltf.CreatedOn) = month(now()) and list.ListName like 'CLOSED' and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
$sltCount=$this->db->query($sltsql);
$slcount = $sltCount->result();
if (count($lcount) > 0) {
@ -557,7 +557,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 date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSED' and lt.CreatedBranch = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
//to staff
@ -570,7 +570,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 date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
and date(ltf.CreatedOn) = date(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSED' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
$sltd=$this->db->query($ssql);
$stlead = $sltd->result();
if (count($tlead) > 0) {
@ -594,10 +594,9 @@ 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(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' ";
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSED' and lt.CreatedBranch = '".$branchId."' ";
$ltd=$this->db->query($sql);
$tlead = $ltd->result();
// echo $sql;
//to staff
$ssql = "select InteractionID,ifnull(date_format(ltf.CreatedOn,'%d-%m-%Y'),'-') as date,ltf.TrackingID as TrackingId,ifnull(ltf.FollowupOn,'-') as followUpDate,ld.LeadName as name,ifnull(ld.MobileNumber,'-') as mobileNo,lt.University as university,lt.Course as course,list.ListName as status,ltf.FollowupComments as cmnts,ifnull(am.ActivityName,'-') as activity,sd.FirstName as AssignTo
from T_Lead_Tracking_Followup as ltf
@ -608,10 +607,9 @@ 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(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSE' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
and month(ltf.CreatedOn) = month(now()) and ltf.IsActive = 1 and am.ActivityName like 'Adm%' and list.ListName like 'CLOSED' and lt.CreatedBranch = '".$branchId."' and ltf.AssignedStaff = '".$requestedBy."' ";
$sltd=$this->db->query($ssql);
$stlead = $sltd->result();
if (count($tlead) > 0) {
$results['lList'] = true;
$results['l_data'] = $tlead;