Commit 8adc3e53 authored by hujun's avatar hujun

有VIP盘权限处理

parent 56a0777c
......@@ -418,6 +418,7 @@ class Houses extends Basic
$m_agent = new AAgents();
$s_house = new HouseService();
$collect_house = new ACollectHouse();
$check_auth = new VipService();
foreach ($list as $k=>$v) {
$list[$k]["is_look"] = $look_shop->isLooked($this->userId, $v["id"]);
......@@ -463,11 +464,17 @@ class Houses extends Basic
}
}
$list[$k]['auth_edit_house'] = 0;
//盘方对自己的商铺有编辑权限
if (in_array($v['id'], $house_id_arr)) {
$list[$k]['auth_edit_house'] = 1;
} else {
$list[$k]['auth_edit_house'] = 0;
if ($v['is_vip']) {
$is_check = $check_auth->checkRule($this->userId, 'index/vipHouse');
if ($is_check) {
$list[$k]['auth_edit_house'] = 1;
}
}
}
//独家方
......
......@@ -13,6 +13,7 @@ namespace app\index\extend;
use app\api_broker\service\RedisCacheService;
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\GHouses;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\model\Users;
......@@ -190,7 +191,7 @@ class Basic extends Controller
if ($is_auth == 0) {
//处理盘方编辑商铺
if ($requestPath == 'index/houseEdit' && isset($this->params['id'])) {
$agent_house = new GHousesToAgents();
if (empty($this->params['id'])) {
$is_auth = 1;
} else {
......@@ -205,7 +206,6 @@ class Basic extends Controller
//处理店长权限
if (!$is_auth) {
$agent_house = new GHousesToAgents();
$where_agent['a.houses_id'] = $this->params['id'];
$where_agent['a.type'] = 2;
$where_agent['a.is_del'] = 0;
......@@ -221,6 +221,19 @@ class Basic extends Controller
$is_auth = $is_ > 0 ? 1:0;
}
}
//有VIP盘权限处理
if (!$is_auth) {
$m_house = new GHouses();
$is_vip = $m_house->getHouseValue('is_vip', ['id'=>$this->params['id']]);
if ($is_vip) {
$check_auth = new VipService();
$check_rule = $check_auth->checkRule($this->userId, 'index/vipHouse');
if (!$check_rule) {
$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