Commit a9d30e0e authored by clone's avatar clone

1

parent 92d77006
...@@ -104,13 +104,16 @@ class Report extends Basic ...@@ -104,13 +104,16 @@ class Report extends Basic
* 获取报备列表 * 获取报备列表
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\BindParamException * @throws \think\db\exception\BindParamException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function reportList() public function reportList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" =>5741, "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,
...@@ -130,17 +133,23 @@ class Report extends Basic ...@@ -130,17 +133,23 @@ class Report extends Basic
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
$result = []; $result = [];
if(isset($params["is_all"]) && $params["is_all"] == 1){ //todo 总监账号看全部带看记录 by 190708
$check_type = $this->service_->getCheckType($this->agentId); $agentModel = new AAgents();
if ($check_type == 0) { $agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
return $this->response(101, "暂无权限"); if($agents_data["level"] == 30 || $agents_data["level"] == 40 ){
} $result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,1);
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,$check_type);
}else{ }else{
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize); if( isset($params["is_all"]) && $params["is_all"] == 1){
$check_type = $this->service_->getCheckType($this->agentId);
if ($check_type == 0) {
return $this->response(101, "暂无权限");
}
$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 {
...@@ -198,7 +207,6 @@ class Report extends Basic ...@@ -198,7 +207,6 @@ 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_->orderListForPc($field, $params, $pageNo, $pageSize);
$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);
......
...@@ -111,23 +111,29 @@ class ReportService ...@@ -111,23 +111,29 @@ class ReportService
{ {
//todo 获取我报备的我的案场的, //todo 获取我报备的我的案场的,
//如果是店长则获取其下所有的经纪人 这里去掉了for190218 //如果是店长则获取其下所有的经纪人 这里去掉了for190218
$vModel = new VerifyService(); $agentModel = new AAgents();
// $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]); $agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
$params["agent_id_s"] = array( "in", $params["report_agent_id"] ); if($agents_data["level"] == 30 || $agents_data["level"] == 40 ) {
$caseHouseId = $vModel->getCaseHouseIdByAgentIdV2($params["agent_id_s"]); $vModel = new VerifyService();
$ids = ""; $params["agent_id_s"] = array("in", $params["report_agent_id"]);
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) { $caseHouseId = $vModel->getCaseHouseIdByAgentIdV2($params["agent_id_s"]);
$ids .= $item["houses_id"] . ","; $ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
}
} }
}
$ids = rtrim($ids, ","); $ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0; $ids = $ids ? $ids : 0;
$params["house_ids"] = $ids; $params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize); $result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
}else{
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize,1);
}
return $this->returnResult($result); return $this->returnResult($result);
} }
...@@ -220,49 +226,6 @@ class ReportService ...@@ -220,49 +226,6 @@ class ReportService
return $this->returnResult($result); return $this->returnResult($result);
} }
/**
* 报备订单列表
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return mixed|null
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function orderListForPc($field, $params, $pageNo, $pageSize)
{
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
$vModel = new VerifyService();
$agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
if ($agentArr) {
$params["agent_id_s"] = array( "in", $agentArr );
$params["report_agent_id"] = $agentArr;
}
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
}
}
$ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0;
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$count = $this->oReportModel->selectReportCount($field,$params);
if (count($result) > 0) {
$data["result"] = $this->returnResult($result);
$data["total"] = $count[0]["total"] ? $count[0]["total"] : 0;
return $data;
}
return null;
}
public function orderSign($ids_str) public function orderSign($ids_str)
{ {
......
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