Commit 263ac04f authored by zhuwei's avatar zhuwei

约带看列表

parent e6785dcb
...@@ -136,7 +136,7 @@ class Report extends Basic ...@@ -136,7 +136,7 @@ class Report extends Basic
if ($check) { if ($check) {
return $this->response(101, "暂无权限"); return $this->response(101, "暂无权限");
} }
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize); $result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize,1);
}else{ }else{
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize); $result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
} }
...@@ -149,6 +149,62 @@ class Report extends Basic ...@@ -149,6 +149,62 @@ class Report extends Basic
} }
} }
public function reportListV2()
{
$params = $this->params;
$params = array(
"agent_id" => 5741,
"type" => 2,//1表示全部 2表示进场 3 表示收款 4成交报告
"is_all" => 1,//0搜索我自己的,1全部
"page_no" => 1,
"page_size" => 15
);
if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,
b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = [];
$check_type = 0;
if(isset($params["is_all"]) && $params["is_all"] == 1){
$vip = new VipService();
if($vip->vip($this->agentId, 'inspectionRecordAll/3')){//代表公司
$check_type = 1;
}
if($vip->vip($this->agentId, 'inspectionRecordDistrict/2')){//代表部门
$check_type = 2;
}
if($vip->vip($this->agentId, 'inspectionRecordStore/1')){//代表门店
$check_type = 3;
}
$check_type = 1;
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) {
return $this->response("200", "request success", ['list'=>$result,'check_type'=>$check_type]);
} else {
return $this->response("200", "request null");
}
}
/** /**
* 获取报备列表 pc * 获取报备列表 pc
* @return \think\Response * @return \think\Response
......
...@@ -109,7 +109,7 @@ class Basic extends Controller ...@@ -109,7 +109,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1]; $requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口 //过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) { if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify(); // $this->tokenVerify();
//$this->userAuth(trim($requestPath)); //$this->userAuth(trim($requestPath));
} }
unset($this->params["AuthToken"]); unset($this->params["AuthToken"]);
......
...@@ -112,7 +112,7 @@ class ReportService ...@@ -112,7 +112,7 @@ class ReportService
// $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]); // $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
$params["agent_id_s"] = array( "in", $params["report_agent_id"] ); $params["agent_id_s"] = array( "in", $params["report_agent_id"] );
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]); $caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($params["agent_id_s"]);
$ids = ""; $ids = "";
if (count($caseHouseId) > 0) { if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) { foreach ($caseHouseId as $item) {
...@@ -184,9 +184,36 @@ class ReportService ...@@ -184,9 +184,36 @@ class ReportService
* @throws \think\db\exception\BindParamException * @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException * @throws \think\exception\PDOException
*/ */
public function orderListAll($field, $params, $pageNo, $pageSize) public function orderListAll($field, $params, $pageNo, $pageSize,$check_type)
{ {
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize); $vModel = new VerifyService();
$result = [];
switch ($check_type) {
case 1 :
$result = $this->oReportModel->selectReportListAll($field, $params, $pageNo, $pageSize);
break;
case 2 :
case 3 :
$agentArr = $vModel->getAgentsByAgentIdAndType($params["report_agent_id"], $check_type);
$params["agent_id_s"] = array( "in", $agentArr);
$params["report_agent_id"] = $agentArr;
$caseHouseId = $vModel->getPanpartyAndExclusiveHouseIdByAgentId($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);
break;
default:
}
return $this->returnResult($result); return $this->returnResult($result);
} }
......
...@@ -59,6 +59,35 @@ class VerifyService ...@@ -59,6 +59,35 @@ class VerifyService
return null; return null;
} }
public function getAgentsByAgentIdAndType($agent_id,$type)
{
$params["id"] = $agent_id;
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
if (count($result) > 0) {
$arr_list = [];
switch ($type) {
case 2:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", ["district_id" => $result[0]["district_id"]]);
break;
case 3:
$arr_list = $this->agentModel->searchAgentsByKeyword("id", ["store_id" => $result[0]["store_id"]]);
break;
default:
return $agent_id;
break;
}
$ids = "";
if (count($arr_list) > 0) {
foreach ($arr_list as $item) {
$ids .= $item["id"] . ",";
}
}
$ids = rtrim($ids, ",");
return $ids;
}
return null;
}
/** /**
* 经纪人身份验证 获取经纪人 * 经纪人身份验证 获取经纪人
...@@ -196,6 +225,27 @@ class VerifyService ...@@ -196,6 +225,27 @@ class VerifyService
} }
/**
* 获取我的盘方和独家
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public function getPanpartyAndExclusiveHouseIdByAgentId($agent_id)
{
$houseToAgentModel = new GHousesToAgents();
$params["a.agents_id"] = $agent_id;
$params["a.type"] = array("in",'2,3'); //盘方和独家
$params["a.is_del"] = 0;
$house_arr = $houseToAgentModel->getHouseByAgentId("a.houses_id,b.internal_title", $params);
if (count($house_arr) > 0) {
return $house_arr;
}
return null;
}
/** /**
* 获取我的盘方 楼盘 * 获取我的盘方 楼盘
* @param $agent_id * @param $agent_id
......
...@@ -644,6 +644,7 @@ Route::group('broker', [ ...@@ -644,6 +644,7 @@ Route::group('broker', [
'reportList' => ['api_broker/Report/reportList', ['method' => 'get']], 'reportList' => ['api_broker/Report/reportList', ['method' => 'get']],
'reportListV2' => ['api_broker/Report/reportListV2', ['method' => 'get']],
'reportListForPc' => ['api_broker/Report/reportListForPc', ['method' => 'get']], 'reportListForPc' => ['api_broker/Report/reportListForPc', ['method' => 'get']],
'orderDetail' => ['api_broker/OrderLog/orderDetail', ['method' => 'get|post']], 'orderDetail' => ['api_broker/OrderLog/orderDetail', ['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