Commit 392b8387 authored by hujun's avatar hujun

1

parent 528540b2
......@@ -415,7 +415,9 @@ class Houses extends Basic
if (!empty($this->params['site_id'])) {
$service_broker = new BrokerService();
$check_data = $service_broker->checkSite($this->userId, $this->params['site_id']);
if (!$check_data) {
if ($check_data) {
$where['city'] = $this->params['site_id'];
} else {
$where['city'] = $this->city;
}
}
......
......@@ -297,7 +297,9 @@ class Member extends Basic{
if (!empty($this->params['site_id'])) {
$service_broker = new BrokerService();
$check_data = $service_broker->checkSite($this->userId, $this->params['site_id']);
if (!$check_data) {
if ($check_data) {
$where['city'] = $this->params['a.site_id'];
} else {
$where['city'] = $this->city;
}
}
......
......@@ -267,7 +267,10 @@ class BrokerService
*
* @param $agent_id
* @param int $site_id
* @return array|bool|mixed
* @return array|bool|false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function checkSite($agent_id, $site_id = 0) {
$city = [];
......@@ -286,7 +289,7 @@ class BrokerService
$site_id = $m_group_site->getGroupSite('site_id', $where);
if ($site_id['status'] != 'fail' && !empty($site_id['data']['site_id'])) {
$city = $m_site->getSiteByIdColumn($site_id['data']['site_id'], 'id,city');
$city = $m_site->getSiteByIdList($site_id['data']['site_id'], 'id,city');
}
if (empty($city)) {
......
......@@ -76,15 +76,16 @@ class ASite extends BaseModel
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSiteByIdColumn($id, $fields)
public function getSiteByIdList($id, $fields)
{
$return = $this->where('id', 'in',$id)->column($fields);
$return = $this->field($fields)->where('id', 'in',$id)->select();
return $return;
}
......
......@@ -366,7 +366,6 @@ Route::group('api', [
'appraiser' => [ 'api/broker/appraiser', [ 'method' => 'post' ] ], //评价经纪人
'recordCallNum' => [ 'api/broker/recordCallNum', [ 'method' => 'post' ] ], //记录拨打经纪人号码
'recordCallNumShare' => [ 'api/broker/recordCallNumShare', [ 'method' => 'post' ] ], //记录拨打经纪人号码
'getAgentGroupSite' => [ 'api/broker/getAgentGroupSite', [ 'method' => 'GET' ] ], //获得经纪人站点城市
//get member
'logout' => [ 'api/member/logout', [ 'method' => 'get' ] ],
......@@ -521,6 +520,7 @@ Route::group('broker', [
'uploadHeadImg' => [ 'api_broker/Broker/uploadHeadImg', [ 'method' => 'post' ] ], //经纪人上传头像
'editClient' => [ 'api_broker/Client/editClient', [ 'method' => 'get|post' ] ],//添加和编辑客户
'getBroker' => [ 'api_broker/broker/getBroker', [ 'method' => 'get' ] ],//获取经纪人列表
'getAgentGroupSite' => [ 'api_broker/broker/getAgentGroupSite', [ 'method' => 'get' ] ],//获得经纪人站点
'labelEdit' => [ 'api_broker/label/index', [ 'method' => 'get|post' ] ], //编辑标签
'getLabelsList' => [ 'api_broker/label/getLabelsList', [ 'method' => 'get' ] ], //标签列表
'add_phone_follow_up' => [ 'api_broker/broker/add_phone_follow_up', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
......
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