Commit 502c8840 authored by clone's avatar clone

bug

parent 9de2b588
...@@ -4,6 +4,7 @@ namespace app\api_broker\controller; ...@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\api_broker\service\ReportService; use app\api_broker\service\ReportService;
use app\model\AAgents;
use app\model\FollowUpLogModel; use app\model\FollowUpLogModel;
use app\model\OReportModel; use app\model\OReportModel;
use think\Exception; use think\Exception;
...@@ -85,13 +86,13 @@ class Report extends Basic ...@@ -85,13 +86,13 @@ class Report extends Basic
*/ */
public function reportList() public function reportList()
{ {
/* $params = array( /* $params = array(
"agent_id" =>1, "agent_id" =>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告 "type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1, "page_no"=>1,
"page_size"=>15 "page_size"=>15
);*/ );*/
$params = $this->params; $params = $this->params;
if (!isset($params["agent_id"]) || !isset($params["type"])) { if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
...@@ -114,6 +115,61 @@ class Report extends Basic ...@@ -114,6 +115,61 @@ class Report extends Basic
} }
/**
* 权限判定
* @return \think\Response
*/
public function appAgentAuth()
{
$params = $this->params;
/* $params = array(
"agent_id" => 51,
);*/
$auth_arr = [
'broker/report',
'broker/addFollowUp',
'broker/marchIn',
'broker/collectingBill',
'broker/refund',
'broker/bargain',
'broker/statusBargain',
];
$param["name"] = array( "in", $auth_arr );
$agents = new AAgents();
$is_auth = $agents->agentsAuthIds($params["agent_id"], $param);
$result["report"] = $result["addFollowUp"] = $result["marchIn"] = $result["collectingBill"] = $result["refund"]
= $result["bargain"] = $result["statusBargain"] = false;
if (count($is_auth) > 0) {
foreach ($is_auth as $item) {
if ($item['name'] == "broker/report") {
$result["report"] = true;
}
if ($item['name'] == "broker/addFollowUp") {
$result["addFollowUp"] = true;
}
if ($item['name'] == "broker/marchIn") {
$result["marchIn"] = true;
}
if ($item['name'] == "broker/collectingBill") {
$result["collectingBill"] = true;
}
if ($item['name'] == "broker/refund") {
$result["refund"] = true;
}
if ($item['name'] == "broker/bargain") {
$result["bargain"] = true;
}
if ($item['name'] == "broker/statusBargain") {
$result["statusBargain"] = true;
}
}
return $this->response("200", "request success", $result);
}
return $this->response("200", "request null");
}
/** /**
* 新增跟进 * 新增跟进
......
This diff is collapsed.
...@@ -367,6 +367,8 @@ Route::group('broker', [ ...@@ -367,6 +367,8 @@ Route::group('broker', [
'searchAgents' => ['api_broker/OrderLog/searchAgents', [ 'method' => 'get' ] ], 'searchAgents' => ['api_broker/OrderLog/searchAgents', [ 'method' => 'get' ] ],
'appAgentAuth' => ['api_broker/Report/appAgentAuth', [ 'method' => 'get' ] ],
'center' => ['api_broker/MyCenter/center', [ 'method' => 'get|post' ] ], 'center' => ['api_broker/MyCenter/center', [ 'method' => 'get|post' ] ],
'houseEdit' => ['api_broker/shop/edit', ['method' => 'get|post']], //编辑商铺 'houseEdit' => ['api_broker/shop/edit', ['method' => 'get|post']], //编辑商铺
......
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