Commit 60a29a19 authored by hujun's avatar hujun

1

parent 313d156b
......@@ -77,10 +77,8 @@ class DailyPaperService
// if ($agent_info["level"] != 20 && $agent_info["level"] != 40) {
// return ["code" => 101, "msg" => "非店长不能查看日报"];
// }
$check_data = $this->checkAgent($agent_info['id'], $agent_info['store_id'], $agent_info['district_id']);
if ($check_data['code'] == 200) {
$result['store_name'] = $check_data['data'];
} else {
$check_data = $this->checkAgent($agent_info['id']);
if ($check_data['code'] != 200) {
return ["code" => 101, "msg" => $check_data['msg']];
}
......@@ -681,22 +679,20 @@ class DailyPaperService
}
/**
* 检查用户权限并获取门店
* 检查用户权限
*
* @param $agent_id
* @param $store_id
* @param $district_id
* @return array
*/
public function checkAgent($agent_id, $store_id) {
public function checkAgent($agent_id) {
$check_rule = new VipService();
$storeModel = new AStore();
$is_ = $check_rule->checkRule($agent_id, 'index/dailyDetail');
if ($is_) {
$result = ["code"=>101, "msg"=>"没有查看财务日报权限"];
} else {
$data = $storeModel->getStoreKeyById('store_name', ['id'=>$store_id]);
$result = ["code"=>200, "data"=>$data];
$result = ["code"=>200];
}
return $result;
}
......
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