Commit fefc3ab1 authored by hujun's avatar hujun

客户列表与商品列表站点控制

parent 3b8d0196
......@@ -11,6 +11,7 @@ namespace app\index\controller;
use app\api_broker\service\LookShopService;
use app\index\extend\Basic;
use app\index\service\BrokerService;
use app\index\service\HouseService;
use app\index\validate\HouseValidate;
use app\model\AAgents;
......@@ -235,10 +236,6 @@ class Houses extends Basic
$where['shop_type'] = $this->params['shop_type'];
}
if ($this->userId != 1) {
$where['city'] = $this->city;
}
/*所在区*/
if (!empty($this->params['disc'])) {
$where['disc'] = $this->params['disc'];
......@@ -415,6 +412,15 @@ class Houses extends Basic
$where['is_lock'] = $this->params['is_lock'];
}
$service_broker = new BrokerService();
$check_data = $service_broker->checkSite($this->userId);
if ($check_data) {
if ($check_data['city'] != 'all') {
$where['city'] = ['in', $check_data['city']];
}
} else {
$where['city'] = $this->city;
}
$list = $this->house->getHouseListDish($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListTotal($where);
......
......@@ -6,6 +6,7 @@ use app\api_broker\service\ClientService;
use app\api_broker\service\VipService;
use app\extra\RedisExt;
use app\index\extend\Basic;
use app\index\service\BrokerService;
use app\index\service\UserService;
use app\model\AAgents;
use app\model\ACollectUser;
......@@ -291,7 +292,23 @@ class Member extends Basic{
if($if_search_user) {
#if_search_user 存在精确搜索客户姓名,电话,编号 则变成 false
$where['a.site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];//默认显示经纪人所在站点的客户
// $where['a.site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];//默认显示经纪人所在站点的客户
$service_broker = new BrokerService();
$check_data = $service_broker->checkSite($this->userId);
if ($check_data) {
if ($check_data['site_id'] != 'all') {
if (!empty($check_data['site_id'])) {
$site_id = explode(',', $check_data['site_id']);
foreach ($site_id as $k=>$v) {
$site_id[$k] = intval($v); //转为整型
}
$where['a.site_ids'] = [ 'in', $site_id];
}
}
} else {
$where['a.site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];
}
}
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.user_label,
......@@ -364,7 +381,7 @@ class Member extends Basic{
} catch (\Exception $e) {
return $this->response(101, '内部错误,获取客户失败!请联系运营。');
return $this->response(101, '内部错误,获取客户失败!请联系运营。'.$e->getMessage());
}
$return = $this->response($data['status'], $data['msg'], $data);
......
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