Commit eb0842e9 authored by hujun's avatar hujun

总监和店长列表费用报销

parent 47de5e17
...@@ -29,7 +29,7 @@ class ApplyForCost extends Basic ...@@ -29,7 +29,7 @@ class ApplyForCost extends Basic
public function costList() { public function costList() {
$pageNo = empty($this->params['page_no']) ? 1 : $this->params['page_no']; $pageNo = empty($this->params['page_no']) ? 1 : $this->params['page_no'];
$pageSize = empty($this->params['page_size']) ? 15 : $this->params['page_size']; $pageSize = empty($this->params['page_size']) ? 15 : $this->params['page_size'];
$where['a.is_del'] = 0;
if (!empty($this->params['site_id'])) { if (!empty($this->params['site_id'])) {
$where['a.site_id'] = $this->params['site_id']; $where['a.site_id'] = $this->params['site_id'];
} }
...@@ -43,13 +43,16 @@ class ApplyForCost extends Basic ...@@ -43,13 +43,16 @@ class ApplyForCost extends Basic
$check_url = 'index/checkCostTwo/1'; $check_url = 'index/checkCostTwo/1';
$where['a.status'] = 0; $where['a.status'] = 0;
$get_check_user = 'index/getCostListOne/0';
$is_check = $this->checkAuth($get_check_user);
if ($is_check) {
$where['a.store_id'] = $agent_data['store_id'];
} else {
$m_agent = new AAgents(); $m_agent = new AAgents();
$district_id = $m_agent->getAgentsByWhereColumn(['id'=>['<>', $this->agentId],'phone'=>$this->agentPhone], 'district_id'); $district_id = $m_agent->getAgentsByWhereColumn(['phone'=>$this->agentPhone], 'district_id');
if ($district_id) { if ($district_id) {
$district_id[] = $agent_data['district_id']; $where['b.district_id'] = ['in', $district_id]; //总监多个账号查看
$where['b.district_id'] = ['in', $district_id]; }
} else {
$where['b.district_id'] = $agent_data['district_id'];
} }
break; break;
case 2 : case 2 :
...@@ -57,14 +60,25 @@ class ApplyForCost extends Basic ...@@ -57,14 +60,25 @@ class ApplyForCost extends Basic
//总监权限查看 //总监权限查看
$where['a.status'] = 1; $where['a.status'] = 1;
$get_check_user = 'index/getCostListTwo/1';
$is_check = $this->checkAuth($get_check_user);
if ($is_check) {
$get_check_user = 'index/getCostListOne/0';
$is_check = $this->checkAuth($get_check_user);
if ($is_check) {
$where['a.store_id'] = $agent_data['store_id']; //店长查看
} else {
$m_agent = new AAgents(); $m_agent = new AAgents();
$district_id = $m_agent->getAgentsByWhereColumn(['id'=>['<>', $this->agentId],'phone'=>$this->agentPhone], 'district_id'); $district_id = $m_agent->getAgentsByWhereColumn(['phone'=>$this->agentPhone], 'district_id');
if ($district_id) { if ($district_id) {
$district_id[] = $agent_data['district_id']; $district_id[] = $agent_data['district_id'];
$where['b.district_id'] = ['in', $district_id]; $where['b.district_id'] = ['in', $district_id]; //总监多个账号查看
} else { }
$where['b.district_id'] = $agent_data['district_id']; }
} }
//财务一审查看
break; break;
case 3 : case 3 :
$get_check_user = 'index/getCostListThree/2'; $get_check_user = 'index/getCostListThree/2';
......
...@@ -433,6 +433,7 @@ class RedisCacheService ...@@ -433,6 +433,7 @@ class RedisCacheService
$rules_arr = explode(',', $rules); $rules_arr = explode(',', $rules);
$result = 1; $result = 1;
big_log(json_encode($rules_arr), 'check_rule');
if (in_array($auth_rule_id, $rules_arr)) { if (in_array($auth_rule_id, $rules_arr)) {
$result = 0; $result = 0;
} }
......
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