Commit 00cf5e69 authored by zhuwei's avatar zhuwei

查询当前登录人权限

parent c1c47869
...@@ -43,4 +43,26 @@ class VipService ...@@ -43,4 +43,26 @@ class VipService
return 1; return 1;
} }
} }
/**
* 根据经纪人id判断是否具有某些角色
* @param $agent_id
* @param $group_id
* @return bool
*/
public function getGroup($agent_id, $group_id)
{
if (!$agent_id or !$group_id) {
return false;
}
$agent = new AAgents();
$fields = 'auth_group_id';
$auth_group_id = $agent->getAgentsById($agent_id, $fields);
$rules_arr = explode(',', $group_id);
if (in_array($auth_group_id, $rules_arr)) {
return true;
} else {
return false;
}
}
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace app\index\controller; namespace app\index\controller;
use app\api_broker\service\VipService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\service\ImageDepotService; use app\index\service\ImageDepotService;
use app\index\service\UserService; use app\index\service\UserService;
...@@ -176,19 +177,12 @@ class ImageDepot extends Basic ...@@ -176,19 +177,12 @@ class ImageDepot extends Basic
//查询客户是否在保护期内 //查询客户是否在保护期内
//判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期 //判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期
$user_service = new UserService(); $vip_services = new VipService();
// $is_outstrip_twenty_four_hours = $user_service->isUserProtect(1); //是否可以查看vip客户 0:可查看 1:不可查看
// dump($is_outstrip_twenty_four_hours); $agent_id = 51;
// if ($is_outstrip_twenty_four_hours == 0) { $group_id = '2,3,4,5';
// dump('保护器内'); $res = $vip_services->getGroup($agent_id, $group_id);
// } else { dump($res);
// dump('超过保护期');
// }
$user_agent_id =5747;
$agent_id =1;
$user_service->isUserAgentDirector($user_agent_id,$agent_id);
} }
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
namespace app\index\controller; namespace app\index\controller;
use app\api_broker\service\VipService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\untils\ExportExcelUntil; use app\index\untils\ExportExcelUntil;
use app\model\OBargainModel; use app\model\OBargainModel;
...@@ -136,6 +137,9 @@ class PerformanceInfo extends Basic ...@@ -136,6 +137,9 @@ class PerformanceInfo extends Basic
*/ */
public function getPerformanceInfoExcel() public function getPerformanceInfoExcel()
{ {
//查询当前登录人权限
$vip_services = new VipService();
$get_group_res = $vip_services->getGroup($this->userId, '2,3,4,5');
$where['Obargain.status'] = $this->status; $where['Obargain.status'] = $this->status;
/*开始结束时间*/ /*开始结束时间*/
...@@ -223,9 +227,14 @@ class PerformanceInfo extends Basic ...@@ -223,9 +227,14 @@ class PerformanceInfo extends Basic
} }
//商铺地址截取字符串前3位,后面做隐藏 --暂时不用,后期可直接解除注释 //商铺地址截取字符串前3位,角色'2,3,4,5'的做隐藏
// $landmark = $v["internal_address"] ? mb_substr($v["internal_address"],0,3,'utf-8').'****' : ''; if($v["internal_address"] && $get_group_res){
$e_data_old['landmark'] = $v["internal_address"] ? mb_substr($v["internal_address"],0,3,'utf-8').'****' : '';//商铺地址 $landmark = mb_substr($v["internal_address"],0,3,'utf-8').'****';
}else{
$landmark = $v["internal_address"] ;
}
$e_data_old['landmark'] = $landmark;//商铺地址
$e_data_old['house_id'] = $v['house_id'];//商铺编号 $e_data_old['house_id'] = $v['house_id'];//商铺编号
//$e_data_old['name_phone'] = $v['name'].'-'.$v['phone'];//分佣提成方 //$e_data_old['name_phone'] = $v['name'].'-'.$v['phone'];//分佣提成方
$e_data_old['name_phone'] = $v['name'];//分佣提成方 $e_data_old['name_phone'] = $v['name'];//分佣提成方
......
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