Subversion Repositories SmartDukaan

Rev

Rev 17976 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17976 Rev 20117
Line 179... Line 179...
179
		
179
		
180
		$this->set('result', $resul);
180
		$this->set('result', $resul);
181
	}
181
	}
182
 
182
 
183
	public function admin_backlog() {
183
	public function admin_backlog() {
184
		$backupSql="select ifnull(agent_id,'General') as agent_id,status,count(1) as count from retailers where status IN ('onboarding','followup') and (agent_id is NULL or agent_id=17) group by status,agent_id";	
184
// 		$backupSql="select ifnull(agent_id,'General') as agent_id,status,count(1) as count from retailers where status IN ('onboarding','followup') and (agent_id is NULL or agent_id=17) group by status,agent_id";
-
 
185
		$backupSql = "select r.status as status,count(1) as count, ifnull(a.name,'General') as agent_id from retailers r left join agents a on r.agent_id= a.id where r.status IN ('onboarding','followup')  group by r.status,r.agent_id";
185
		$resul=$this->Callhistory->query($backupSql);	
186
		$resul=$this->Callhistory->query($backupSql);	
186
		$this->set('result', $resul);		
187
		$this->set('result', $resul);		
187
	}
188
	}
188
}
189
}
189
190