Commit 44a4f461 authored by hujun's avatar hujun

职称和角色

parent c7594dee
<?php
namespace app\api_broker\controller;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018-11-12
* Time: 10:25:16
*/
use app\api_broker\extend\Basic;
use app\model\AAgents;
class Agent extends Basic
{
protected $aAgents;
public function __construct($request = null)
{
parent::__construct($request);
$this->aAgents = new AAgents();
}
/**
* 消息页面--通讯录
* User: 朱伟
* Date: 2018-11-12
* Time: 10:49:56
* 接口文档 http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=680
*/
public function getPhoneBook()
{
$params = $this->params;
$where = [];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
if (!empty($params['keyword'])) {
$where['Agents.name|Agents.phone'] = [ 'LIKE', '%' . $params['keyword'] . '%' ];
}
$field = 'Agents.id as agent_id,';
$field .= 'Agents.name,';
$field .= 'Agents.img,';
$field .= 'Agents.status,';
$field .= 'Agents.phone';
$res = $this->aAgents->getPhoneBookList($field, $where, $pageSize, $pageNo);
foreach ($res as $key => $val) {
$res[$key]['head_portrait'] = AGENTHEADERIMGURL . $val['img'];
}
$res_total = $this->aAgents->getPhoneBookListTotal($where);
return $this->response("200", "成功",['data'=>$res,'total'=>$res_total]);
}
}
\ No newline at end of file
......@@ -910,4 +910,40 @@ class Broker extends Basic
return $this->response($data['status'], $data['msg'], $data['data']);
}
/**
* 消息页面--通讯录
* User: 朱伟
* Date: 2018-11-12
* Time: 10:49:56
* 接口文档 http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=680
*/
public function getPhoneBook()
{
$params = $this->params;
$where = [];
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
if (!empty($params['keyword'])) {
$where['Agents.name|Agents.phone'] = [ 'LIKE', '%' . $params['keyword'] . '%' ];
}
$field = 'Agents.id as agent_id,';
$field .= 'Agents.name,';
$field .= 'Agents.img,';
$field .= 'Agents.status,';
$field .= 'Agents.phone';
$res = $this->a_agents->getPhoneBookList($field, $where, $pageSize, $pageNo);
foreach ($res as $key => $val) {
$res[$key]['head_portrait'] = AGENTHEADERIMGURL . $val['img'];
}
$res_total = $this->a_agents->getPhoneBookListTotal($where);
return $this->response("200", "成功",['data'=>$res,'total'=>$res_total]);
}
}
\ No newline at end of file
<?php
namespace app\api_broker\service;
use app\model\AAgents;
use app\model\AuthGroup;
/**
* Created by PhpStorm.
......@@ -23,13 +24,17 @@ class MyCenterService{
}
/**
* 我得个人中心
* 我的个人中心
*
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
* @return false|mixed|null|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function center($agent_id){
$field = "a.id,a.store_id,a.auth_group_id,a.district_id,a.level,a.name,a.phone,a.sex,a.img,a.status,b.store_name,
c.district_name";
c.district_name,a.position";
$params["agent_id"] = $agent_id;
......@@ -55,6 +60,11 @@ class MyCenterService{
//todo 需要计算暂时没做。
//$result["money_total"] = 1000;
if (!empty($result['auth_group_id'])) {
$m_auth_group = new AuthGroup();
$auth_group_name = $m_auth_group->getValue('title', ['id'=>$result['auth_group_id']]);
$result['auth_group_name'] = empty($auth_group_name) ? '':$auth_group_name;
}
return $result;
}
}
\ No newline at end of file
......@@ -724,7 +724,7 @@ Route::group('broker', [
'getAgentSiteList' => [ 'api_broker/Site/getAgentSiteList', [ 'method' => 'POST|GET' ] ], //获取经纪人站点列表
'getPhoneBook' => [ 'api_broker/Agent/getPhoneBook', [ 'method' => 'POST|GET' ] ], //消息页面--通讯录
'getPhoneBook' => [ 'api_broker/broker/getPhoneBook', [ 'method' => 'POST|GET' ] ], //消息页面--通讯录
'commentAndDeal' => [ 'api_broker/broker/commentAndDeal', [ 'method' => 'get' ] ],//获取当前经纪人的评价和交易列表
'addSpreadUser' => [ 'api_broker/SpreadUser/addSpreadUser', [ 'method' => 'POST|GET' ] ],
'getVolume' => [ 'api_broker/SpreadUser/getVolume', [ 'method' => 'POST|GET' ] ],
......
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