Commit 8a84b34d authored by hujun's avatar hujun

check_rule

parent 00d75c80
...@@ -40,7 +40,7 @@ class ApplyForCost extends Basic ...@@ -40,7 +40,7 @@ class ApplyForCost extends Basic
$check_rule = new VipService(); $check_rule = new VipService();
switch ($this->params['type']) { switch ($this->params['type']) {
case 1 : case 1 :
$check_url = 'index/checkCostTwo'; $check_url = 'index/checkCostTwo/1';
$where['a.status'] = 0; $where['a.status'] = 0;
$m_agent = new AAgents(); $m_agent = new AAgents();
...@@ -53,7 +53,7 @@ class ApplyForCost extends Basic ...@@ -53,7 +53,7 @@ class ApplyForCost extends Basic
} }
break; break;
case 2 : case 2 :
$check_url = 'index/checkCostThree'; $check_url = 'index/checkCostThree/2';
//总监权限查看 //总监权限查看
$where['a.status'] = 1; $where['a.status'] = 1;
...@@ -67,10 +67,10 @@ class ApplyForCost extends Basic ...@@ -67,10 +67,10 @@ class ApplyForCost extends Basic
} }
break; break;
case 3 : case 3 :
$check_url = 'index/checkCostFour'; $check_url = 'index/checkCostFour/3';
$where['a.status'] = 2;break; //财务一审 $where['a.status'] = 2;break; //财务一审
case 4 : case 4 :
$check_url = 'index/checkCostFive'; $check_url = 'index/checkCostFive/4';
$where['a.status'] = 3;break; //财务二审 $where['a.status'] = 3;break; //财务二审
case 5 : case 5 :
$where['a.status'] = 4;break; //财务三审 $where['a.status'] = 4;break; //财务三审
...@@ -148,8 +148,30 @@ class ApplyForCost extends Basic ...@@ -148,8 +148,30 @@ class ApplyForCost extends Basic
return $this->response(101, '参数错误'); return $this->response(101, '参数错误');
} }
$check_rule = new VipService();
switch ($this->params['status']) {
case 1 :
$check_url = 'index/checkCostTwo/1';
break;
case 2 :
$check_url = 'index/checkCostThree/2';
break;
case 3 :
$check_url = 'index/checkCostFour/3';
break;
case 4 :
$check_url = 'index/checkCostFive/4';
break;
default :
return $this->response(101, '请求错误');
}
$is_ok = $check_rule->checkRule($this->agentId, $check_url);
if ($is_ok) {
return $this->response(101, '没有审核权限');
}
$service = new CostService(); $service = new CostService();
$this->params['status'] = 1; //总监审核
$result = $service->check($this->params, $this->agentId); $result = $service->check($this->params, $this->agentId);
$code = 200; $code = 200;
if ($result['status'] == 'fail') { if ($result['status'] == 'fail') {
......
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