Subversion Repositories SmartDukaan

Rev

Rev 20117 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20117 Rev 20120
Line 180... Line 180...
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
		$backupSql = "select ifnull(r.agent_id,'General') as agent_id , r.status as status,count(1) as count, ifnull(a.name,'General') as agent_name 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";
186
		$resul=$this->Callhistory->query($backupSql);	
186
		$resul=$this->Callhistory->query($backupSql);
187
		$this->set('result', $resul);		
187
		$this->set('result', $resul);		
188
	}
188
	}
189
}
189
}
190
190