Commit d25eaa98 authored by clone's avatar clone

1

parent 0e801efd
...@@ -30,8 +30,8 @@ class Report extends Basic ...@@ -30,8 +30,8 @@ class Report extends Basic
public function __construct($request = null) public function __construct($request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->service_ = new ReportService(); $this->service_ = new ReportService();
$this->fulModel = new FollowUpLogModel(); $this->fulModel = new FollowUpLogModel();
$this->userService = new UserService(); $this->userService = new UserService();
...@@ -83,11 +83,11 @@ class Report extends Basic ...@@ -83,11 +83,11 @@ class Report extends Basic
$this->userService->setUserSites($user_id, $this->siteId);//设置用户站点 朱伟 2018-10-22 $this->userService->setUserSites($user_id, $this->siteId);//设置用户站点 朱伟 2018-10-22
/*记录推送*/ /*记录推送*/
$push = new PushMessageService(); $push = new PushMessageService();
$house_ids_arr = explode(',', $house_ids); $house_ids_arr = explode(',', $house_ids);
if (is_array($house_ids_arr)) { if (is_array($house_ids_arr)) {
foreach ($house_ids_arr as $k=>$v) { foreach ($house_ids_arr as $k => $v) {
$push->pushReportMessage($v, $agent_id, 1, $this->agentId, $user_id); //推送报备信息 $push->pushReportMessage($v, $agent_id, 1, $this->agentId, $user_id); //推送报备信息
} }
} }
...@@ -112,13 +112,13 @@ class Report extends Basic ...@@ -112,13 +112,13 @@ class Report extends Basic
public function reportList() public function reportList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" =>1, "agent_id" =>1,
"type" => 2,//1表示全部 2表示进场 3 表示收款 4成交报告 "type" => 2,//1表示全部 2表示进场 3 表示收款 4成交报告
"is_all"=>1,//0搜索我自己的,1全部 "is_all"=>1,//0搜索我自己的,1全部
"page_no"=>1, "page_no"=>1,
"page_size"=>15 "page_size"=>15
);*/ );*/
if (!isset($params["agent_id"]) || !isset($params["type"])) { if (!isset($params["agent_id"]) || !isset($params["type"])) {
...@@ -132,24 +132,24 @@ class Report extends Basic ...@@ -132,24 +132,24 @@ class Report extends Basic
b.house_id,b.house_title"; b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
$result = []; $result = [];
//todo 总监账号看全部带看记录 by 190708 //todo 总监账号看全部带看记录 by 190708
$agentModel = new AAgents(); $agentModel = new AAgents();
$agents_data = $agentModel->getAgentInfo('id,level', $this->agentId); $agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
if($agents_data["level"] == 30 || $agents_data["level"] == 40 ){ if (isset($params["is_all"]) && $params["is_all"] == 1) {
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,1); $check_type = 1;
}else{ if ($agents_data["level"] < 30) {
if( isset($params["is_all"]) && $params["is_all"] == 1){
$check_type = $this->service_->getCheckType($this->agentId); $check_type = $this->service_->getCheckType($this->agentId);
if ($check_type == 0) { if ($check_type == 0) {
return $this->response(101, "暂无权限"); return $this->response(101, "暂无权限");
} }
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,$check_type);
}else{
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
} }
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize, $check_type);
} else {
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
} }
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} else { } else {
...@@ -158,7 +158,6 @@ class Report extends Basic ...@@ -158,7 +158,6 @@ class Report extends Basic
} }
/** /**
* 获取权限 * 获取权限
* @return int|\think\Response * @return int|\think\Response
...@@ -169,7 +168,7 @@ class Report extends Basic ...@@ -169,7 +168,7 @@ class Report extends Basic
if ($result == 0) { if ($result == 0) {
return $this->response(101, "暂无权限"); return $this->response(101, "暂无权限");
} else { } else {
return $this->response("200", "request success", ['check_type'=>$result]); return $this->response("200", "request success", ['check_type' => $result]);
} }
} }
...@@ -208,7 +207,7 @@ class Report extends Basic ...@@ -208,7 +207,7 @@ class Report extends Basic
$params["a.id"] = $params["report_id"]; $params["a.id"] = $params["report_id"];
} }
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize); $result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} else { } else {
...@@ -266,7 +265,7 @@ class Report extends Basic ...@@ -266,7 +265,7 @@ class Report extends Basic
'broker/bargain', 'broker/bargain',
/* 'broker/statusBargain',*/ /* 'broker/statusBargain',*/
]; ];
$param["name"] = array( "in", $auth_arr ); $param["name"] = array("in", $auth_arr);
$agents = new AAgents(); $agents = new AAgents();
$is_auth = $agents->agentsAuthIds($params["agent_id"], $param); $is_auth = $agents->agentsAuthIds($params["agent_id"], $param);
......
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