在类似情况下如何使用别名

<?php
public function coassign_by_me($leadbm,$clbm,$cnbm)
	{
		$rep_id=$this->session->userdata('TechUser_Id');
		$rows=$this->db->select("pm1coassign_lead.ticket_id, pm1category.category_name, pm1ticket.subject, pm1ticket.updt_date, pm1contact.id, concat(pm1contact.f_name, ' ', pm1contact.l_name) as client, pm1contact.phonefax, pm1ticket.rep_id as t_rep, rep1.user_name as rep1, rep2.user_name as rep2, pm1status.rep_display, pm1ticket.due_date",false);
					$this->db->from('pm1coassign_lead',true);
					$this->db->join('pm1ticket','pm1ticket.id=pm1coassign_lead.ticket_id');
					$this->db->join('pm1category','pm1category.id=pm1ticket.category_id');
					$this->db->join('pm1contact','pm1contact.id=pm1ticket.customer_id');
					$this->db->join('pm1contact_rep as rep1','pm1ticket.rep_id=rep1.id');
					$this->db->join('pm1contact_rep as rep2','pm1coassign_lead.coassign_rep=rep2.id');
					$this->db->join('pm1status','pm1ticket.status_id=pm1status.id'); 
					$this->db->where('coassign_by',$rep_id);
					if(!empty($leadbm) && $leadbm != ''){
						$this->db->where_in("pm1coassign_lead.ticket_id",$leadbm);
					}
					if(!empty($clbm) && $clbm !=''){
						$this->db->like('client',$clbm);
					}
					if(!empty($cnbm) && $cnbm != ''){
						$this->db->where_in("pm1contact.phonefax",$cnbm);
					}
					$array = $this->db->get();
					echo $this->db->last_query(); die;
		return $array->result_array();
	}
?>

在这里我有一个查询,在哪里我可以在类似条件下使用客户端。我感到困惑。谁能帮帮我吗。

评论