Commit 87bdd896 authored by zw's avatar zw

查询当前调整的成交报告

parent 462038f9
...@@ -291,32 +291,45 @@ class Shop extends Basic ...@@ -291,32 +291,45 @@ class Shop extends Basic
//锁盘后,盘方、独家方、有权限的可以查看 //锁盘后,盘方、独家方、有权限的可以查看
$result[$key]["look_lock"] = 0; $result[$key]["look_lock"] = 0;
if (isset($val['is_lock']) && $val['is_lock'] == 1) { if (isset($val['is_lock']) && $val['is_lock'] == 1) {
$isLook = $this->isLookLock($val['id']);
$result[$key]["look_lock"] = $isLook ? 1 : 0;
}
}
if (empty($result)) {
return $this->response("200", "此条件没有找到数据");
}
return $this->response("200", 'request success', $result);
}
/**
* 判断是否有查看商铺权限
* @param $house_id
* @return bool
*/
private function isLookLock($house_id){
$vip = new VipService(); $vip = new VipService();
if (!$vip->vip($this->agentId, 'index/lockHouse')) { if (!$vip->vip($this->agentId, 'index/lockHouse')) {
$result[$key]["look_lock"] = 1; return true;
} }
$m_agent = new GHousesToAgents(); $m_agent = new GHousesToAgents();
$agent_where['a.agents_id'] = $this->agentId; $agent_where['a.agents_id'] = $this->agentId;
$agent_where['a.type'] = ['in', '2,3']; $agent_where['a.type'] = ['in', '2,3'];
$agent_where['a.houses_id'] = $val['id']; $agent_where['a.houses_id'] = $house_id;
$agent_where['a.is_del'] = 0; $agent_where['a.is_del'] = 0;
$agent_data = $m_agent->getAgentsHouseField('a.id', $agent_where); $agent_data = $m_agent->getAgentsHouseField('a.id', $agent_where);
foreach ($agent_data as $vvv) { foreach ($agent_data as $vvv) {
if ($vvv > 0) { if ($vvv > 0) {
$result[$key]["look_lock"] = 1; return true;
}
}
}
} }
if (empty($result)) {
return $this->response("200", "此条件没有找到数据");
} }
return false;
return $this->response("200", 'request success', $result);
} }
/** /**
...@@ -515,6 +528,11 @@ class Shop extends Basic ...@@ -515,6 +528,11 @@ class Shop extends Basic
return $this->response("101", '此楼盘不存在'); return $this->response("101", '此楼盘不存在');
} }
$is_look = $this->isLookLock($result['id']);
if ( $result['is_lock'] == 1 && !$is_look) {
return $this->response("101", '没有查看权限');
}
if ($result["start_business_date"] == "0000-00-00 00:00:00" || empty($result["start_business_date"])) { if ($result["start_business_date"] == "0000-00-00 00:00:00" || empty($result["start_business_date"])) {
$result["start_business_date"] = ""; $result["start_business_date"] = "";
} else { } else {
......
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