Commit bdc3a9ee authored by hujun's avatar hujun

店长权限

parent 213e2cc8
...@@ -152,7 +152,7 @@ class Basic extends Controller ...@@ -152,7 +152,7 @@ class Basic extends Controller
$agents = new AAgents(); $agents = new AAgents();
$is_auth = $agents->agentsAuth($auth_id, $this->userId); $is_auth = $agents->agentsAuth($auth_id, $this->userId);
$is_auth = empty($is_auth['id']) ? 0:1; $is_auth = empty($is_auth['id']) ? 0:1;
$agent_house = new GHousesToAgents();
if ($is_auth == 0) { if ($is_auth == 0) {
//处理盘方编辑商铺 //处理盘方编辑商铺
if ($requestPath == 'index/houseEdit' && isset($this->params['id'])) { if ($requestPath == 'index/houseEdit' && isset($this->params['id'])) {
...@@ -160,29 +160,29 @@ class Basic extends Controller ...@@ -160,29 +160,29 @@ class Basic extends Controller
if (empty($this->params['id'])) { if (empty($this->params['id'])) {
$is_auth = 1; $is_auth = 1;
} else { } else {
$agent = new GHousesToAgents(); $agent_house = new GHousesToAgents();
$where['houses_id'] = $this->params['id']; $where['houses_id'] = $this->params['id'];
$where['type'] = 2; $where['type'] = 2;
$where['agents_id'] = $this->userId; $where['agents_id'] = $this->userId;
$where['is_del'] = 0; $where['is_del'] = 0;
$is_ = $agent->getTotal($where); $is_ = $agent_house->getTotal($where);
$is_auth = $is_ > 0 ? 1:0; $is_auth = $is_ > 0 ? 1:0;
} }
//处理店长权限 //处理店长权限
if (!$is_auth) { if (!$is_auth) {
$agent = new GHousesToAgents(); $agent_house = new GHousesToAgents();
$where['a.houses_id'] = $this->params['id']; $where_agent['a.houses_id'] = $this->params['id'];
$where['a.type'] = 2; $where_agent['a.type'] = 2;
$where['a.is_del'] = 0; $where_agent['a.is_del'] = 0;
$store_id_arr = $agent->getAgentsHouseField('b.store_id', $where); $store_id_arr = $agent_house->getAgentsHouseField('b.store_id', $where_agent);
if (!empty($store_id_arr)) { if (!empty($store_id_arr)) {
$store_id = implode(',', array_unique($store_id_arr)); $store_id = implode(',', array_unique($store_id_arr));
} }
if (!empty($store_id)) { if (!empty($store_id)) {
$is_ = $agent->getTotal(['store_id'=>$store_id, 'id'=>$this->userId, 'level'=>20]); $is_ = $agents->getTotal(['store_id'=>$store_id, 'id'=>$this->userId, 'level'=>20]);
$is_auth = $is_ > 0 ? 1:0; $is_auth = $is_ > 0 ? 1:0;
} }
} }
...@@ -209,9 +209,8 @@ class Basic extends Controller ...@@ -209,9 +209,8 @@ class Basic extends Controller
//没有独家方编辑权限处理 //没有独家方编辑权限处理
if ($requestPath == 'index/editExclusive' && isset($this->params['exclusive_id'])) { if ($requestPath == 'index/editExclusive' && isset($this->params['exclusive_id'])) {
$m_house_agent = new GHousesToAgents();
//独家方 //独家方
$exclusive_num = $m_house_agent->getAgentHouseNum($this->params['exclusive_id'], $this->params['id'], 3); $exclusive_num = $agent_house->getAgentHouseNum($this->params['exclusive_id'], $this->params['id'], 3);
if ($exclusive_num > 0) { if ($exclusive_num > 0) {
$is_auth = 1; $is_auth = 1;
} }
......
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