Commit 169a0205 authored by hujun's avatar hujun

字段修改

parent eda11ce2
......@@ -11,6 +11,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\api_broker\service\VipService;
use app\model\GBusinessDistrict;
use app\model\GHousesToAgents;
use app\model\OfficeACollectHouse;
use app\model\OfficeGRoom;
......@@ -121,7 +122,8 @@ class OfficeCollectHouse extends Basic
$field .= 'Houses.station_end,';
$field .= 'Houses.floor,';
$field .= 'building.type,';
// $field .= 'Houses.is_vip,';
$field .= 'Houses.floor_tag,';
$field .= 'Houses.is_lock,';
$field .= 'Houses.is_exclusive_type,';
$field .= 'CollectUser.create_time';
// $field .= 'building.disc';
......@@ -131,7 +133,9 @@ class OfficeCollectHouse extends Basic
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectHouse->getCollectListTotal($field,$get_params);
$look_shop_service = new LookShopService();
$m_agent = new OfficeGRoomToAgent();
$vip = new VipService();
$business = new GBusinessDistrict();
foreach ($res as $key => $val) {
$isLook = $look_shop_service->isLooked($params["agents_id"], $val["id"]);
$res[$key]["is_look"] = $isLook;
......@@ -140,25 +144,30 @@ class OfficeCollectHouse extends Basic
//锁盘后,盘方、独家方、有权限的可以查看
$res[$key]["look_lock"] = 0;
if (isset($val['is_lock']) && $val['is_lock'] == 1) {
$vip = new VipService();
if (!$vip->vip($this->agentId, 'index/lockHouse')) {
if (!$vip->vip($this->agentId, 'index/lockOffice')) {
$res[$key]["look_lock"] = 1;
}
}
$m_agent = new OfficeGRoomToAgent();
$agent_where['a.agent_id'] = $this->agentId;
// $agent_where['a.type'] = ['in', '2,3'];
$agent_where['a.type'] = 2;
$agent_where['a.house_id'] = $val['id'];
$agent_where['a.is_del'] = 0;
$agent_data = $m_agent->getAgentsHouseField('a.id', $agent_where);
$agent_where['a.agent_id'] = $this->agentId;
$agent_where['a.type'] = ['in', '2,3'];
$agent_where['a.house_id'] = $val['id'];
$agent_data = $m_agent->getAgentsByRoomId('a.id,a.type,b.name,b.phone', $agent_where);
$res[$key]["name"] = '';
if ($agent_data) {
$res[$key]["look_lock"] = 1;
foreach ($agent_data as $vvv) {
if ($vvv > 0) {
$res[$key]["look_lock"] = 1;
if ($vvv['type'] == 2) {
$res[$key]["name"] = $vvv['name'].'-'.$vvv['phone'];
}
}
}
if (!empty($val['business_district_id'])) {
$res[$key]['business_name'] = $business->getFieldOneValue('name',['id'=>$val['business_district_id']]);
} else {
$res[$key]['business_name'] = '';
}
}
//这里为了将APP跟后台区分开来,pc后台需要total,app不需要
......
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