Commit a42a64c0 authored by zfc's avatar zfc

pc端客户列表修改

parent 136fa753
......@@ -25,6 +25,13 @@ class Member extends Basic{
return view('member/users_list');
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getUserList() {
$data['status'] = 200;
$data['msg'] = '';
......@@ -50,7 +57,7 @@ class Member extends Basic{
if (!empty($params['id'])) {
$where['id'] = $params['id'];
}
$fields = 'id,user_nick,user_phone,user_pic,create_time,user_pswd,referrer_id';
$fields = 'id,user_nick,user_phone,sex,user_pic,create_time,user_pswd,referrer_id,status,source';
$data['list'] = $this->user->getUserAgent($pageNo, $pageSize, '', $fields, $where);
$data['total'] = $this->user->getUserAgentTotal($where);
return $this->response($data['status'], $data['msg'], $data);
......
......@@ -25,14 +25,17 @@ class Users extends Model
/**
* 查询用户和经纪人
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $fields
* @param type $params
* @return type
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $fields
* @param string $params
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getUserAgent($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $fields = '*', $params = '') {
$result = $this->field($fields)
->where($params)
......@@ -42,13 +45,15 @@ class Users extends Model
->select();
$agents = new Agents();
foreach ($result as $k=>$v) {
$data[$k] = $v->getData();
if ($data[$k]['user_pic']) {
$data[$k]['user_pic'] = CURRENT_URL.'static/head_portrait/'.$data[$k]['user_pic'];
} else {
$data[$k]['user_pic'] = '';
}
$data[$k]['follow_time']=Db::table('u_phone_follow_up')
->field('create_time')
->where("user_id",$data[$k]['id'])
->order('id desc')
->value('create_time');
$agent_data = $agents->field('realname,phone')->where('id',$data[$k]['referrer_id'])->find();
$data[$k]['realname'] = $agent_data['realname'];
$data[$k]['phone'] = $agent_data['phone'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment