Commit 60a29a19 authored by hujun's avatar hujun

1

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