|
发表于 2015-1-13 14:30:42
|
显示全部楼层
public function get_real_name($search){
//装在数据库操作类
$DB1=$this->db->database('vm',TRUE);
$DB2=$this->db->database('manage',TRUE);
//查询是否有验证信息
$res=$this->$DB1->select('*')
->from('real_name')
->where('user_id',$search['user_id'])
;
if($res){
$this->db->select('r.*,u.name AS `user_name`,u.`realname`')
->from('`real_name` AS r')
->join('`user` AS u','r.user_id = u.id','left')
->where('u.id',$search['user_id']);
}else{
$rs=$this->$DB2->select('realname')
->from('user')
->where('id',$search['user_id']);
}
} 图片不会发 只好发代码了 |
|