Commit 78b18c21 authored by zw's avatar zw

带看列表bug

parent 9db08c0c
...@@ -357,10 +357,10 @@ class OrderLog extends Basic ...@@ -357,10 +357,10 @@ class OrderLog extends Basic
public function searchOrder() public function searchOrder()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"type" => 4, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 "type" => 1, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"agent_id" => 10014, "agent_id" => 4022,
"search_keyword" => "" "search_keyword" => ""
);*/ );*/
if (!isset($params["type"]) || !isset($params["agent_id"]) || !isset($params["search_keyword"])) { if (!isset($params["type"]) || !isset($params["agent_id"]) || !isset($params["search_keyword"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
......
...@@ -86,13 +86,14 @@ class Report extends Basic ...@@ -86,13 +86,14 @@ class Report extends Basic
*/ */
public function reportList() public function reportList()
{ {
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params = $this->params; $params = $this->params;
/*$params = array(
"agent_id" => 4022,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no" => 1,
"page_size" => 15
);*/
if (!isset($params["agent_id"]) || !isset($params["type"])) { if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
...@@ -122,9 +123,9 @@ class Report extends Basic ...@@ -122,9 +123,9 @@ class Report extends Basic
public function appAgentAuth() public function appAgentAuth()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" => 51, "agent_id" => 51,
);*/ );*/
$auth_arr = [ $auth_arr = [
/*'broker/report', /*'broker/report',
...@@ -133,15 +134,15 @@ class Report extends Basic ...@@ -133,15 +134,15 @@ class Report extends Basic
'broker/collectingBill', 'broker/collectingBill',
'broker/refund', 'broker/refund',
'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);
/* $result["report"] = $result["addFollowUp"] = $result["statusBargain"] =*/ /* $result["report"] = $result["addFollowUp"] = $result["statusBargain"] =*/
$result["marchIn"] = $result["collectingBill"] = $result["refund"] $result["marchIn"] = $result["collectingBill"] = $result["refund"]
= $result["bargain"] = false; = $result["bargain"] = false;
if (count($is_auth) > 0) { if (count($is_auth) > 0) {
foreach ($is_auth as $item) { foreach ($is_auth as $item) {
if ($item['name'] == "broker/marchIn") { if ($item['name'] == "broker/marchIn") {
......
...@@ -687,23 +687,18 @@ class OrderLogService ...@@ -687,23 +687,18 @@ class OrderLogService
b.user_id,b.user_phone,b.user_name,b.predict_see_time"; b.user_id,b.user_phone,b.user_name,b.predict_see_time";
switch ((int)$params["type"]) { switch ((int)$params["type"]) {
case 0: case 0:
// $condition["b.user_phone"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition .= "and b.user_phone like '%" . trim($params['search_keyword']) . "%' "; $condition .= "and b.user_phone like '%" . trim($params['search_keyword']) . "%' ";
break; break;
case 1: case 1:
// $condition["b.user_name"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition .= "and b.user_name like '%" . trim($params['search_keyword']) . "%' "; $condition .= "and b.user_name like '%" . trim($params['search_keyword']) . "%' ";
break; break;
case 2: case 2:
//$condition["b.report_agent_phone"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition .= "and b.report_agent_phone like '%" . trim($params['search_keyword']) . "%' "; $condition .= "and b.report_agent_phone like '%" . trim($params['search_keyword']) . "%' ";
break; break;
case 3: case 3:
//$condition["b.report_agent_name"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition .= "and b.report_agent_name like '%" . trim($params['search_keyword']) . "%' "; $condition .= "and b.report_agent_name like '%" . trim($params['search_keyword']) . "%' ";
break; break;
case 4: case 4:
//$condition["b.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition .= "and a.house_title like '%" . trim($params['search_keyword']) . "%' "; $condition .= "and a.house_title like '%" . trim($params['search_keyword']) . "%' ";
break; break;
case 5: case 5:
...@@ -713,29 +708,24 @@ class OrderLogService ...@@ -713,29 +708,24 @@ class OrderLogService
default: default:
return [ "code" => "101", "msg" => "搜索类型错误" ]; return [ "code" => "101", "msg" => "搜索类型错误" ];
} }
/* if (isset($params["agent_id"])) {
$condition["b.report_agent_id"] = array( "eq", $params["agent_id"] );
}*/
$vModel = new VerifyService(); $vModel = new VerifyService();
$agentArr = $vModel->getAgentsByAgentId($params["agent_id"]); $agentArr = $vModel->getAgentsByAgentId($params["agent_id"]);
$where_ = $condition;
if ($agentArr) { if ($agentArr) {
//$params["report_agent_id"] = $agentArr; $params["report_agent_id"] = $agentArr;
$params["agent_id_s"] = array("in",$agentArr);
$condition .= "and b.report_agent_id in (" . trim($agentArr) . ") "; $condition .= "and b.report_agent_id in (" . trim($agentArr) . ") ";
} }
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["report_agent_id"]); $caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
$ids = ""; $ids = "";
foreach ($caseHouseId as $item) { foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ","; $ids .= $item["houses_id"] . ",";
} }
$ids = rtrim($ids, ","); $ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0; $ids = $ids ? $ids : 0;
//$params["house_ids"] = $ids;
$where_ .= "and a.house_id in ($ids)"; $where_ .= "and a.house_id in ($ids)";
...@@ -748,7 +738,6 @@ class OrderLogService ...@@ -748,7 +738,6 @@ class OrderLogService
return null; return null;
} else { } else {
foreach ($result as $k => $v) { foreach ($result as $k => $v) {
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$ids_str .= $v["id"] . ","; $ids_str .= $v["id"] . ",";
} }
$ids_str = rtrim($ids_str, ","); $ids_str = rtrim($ids_str, ",");
......
...@@ -31,10 +31,14 @@ class ReportService ...@@ -31,10 +31,14 @@ class ReportService
$this->oReportModel = new OReportModel(); $this->oReportModel = new OReportModel();
} }
/** /**
* 验证用户信息 * 验证用户信息
* @param $user_id * @param $user_id
* @return array|null * @return array|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function verifyUser($user_id) public function verifyUser($user_id)
{ {
...@@ -91,25 +95,28 @@ class ReportService ...@@ -91,25 +95,28 @@ class ReportService
} }
} }
/** /**
* 报备订单列表 * 报备订单列表
* @param $field * @param $field
* @param $params * @param $params
* @param $pageNo * @param $pageNo
* @param $pageSize * @param $pageSize
* @return false|null|\PDOStatement|string|\think\Collection * @return mixed|null
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/ */
public function orderList($field, $params, $pageNo, $pageSize) public function orderList($field, $params, $pageNo, $pageSize)
{ {
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人 //todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
$vModel = new VerifyService(); $vModel = new VerifyService();
$agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]); $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
// dump($agentArr);
if ($agentArr) { if ($agentArr) {
$params["agent_id_s"] = array("in",$agentArr);
$params["report_agent_id"] = $agentArr; $params["report_agent_id"] = $agentArr;
} }
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["report_agent_id"]); $caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
$ids = ""; $ids = "";
foreach ($caseHouseId as $item) { foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ","; $ids .= $item["houses_id"] . ",";
...@@ -210,12 +217,16 @@ class ReportService ...@@ -210,12 +217,16 @@ class ReportService
return $this->reportModel->addReport($param); return $this->reportModel->addReport($param);
} }
/** /**
* 订单子表 * 订单子表
* @param $order_no * @param $order_no
* @param $f_id * @param $f_id
* @param $house_id * @param $house_id
* @return mixed * @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
private function orderBin($order_no, $f_id, $house_id) private function orderBin($order_no, $f_id, $house_id)
{ {
......
...@@ -158,9 +158,10 @@ class GHousesToAgents extends BaseModel ...@@ -158,9 +158,10 @@ class GHousesToAgents extends BaseModel
->alias("a") ->alias("a")
->join("g_houses b", "a.houses_id = b.id", "left") ->join("g_houses b", "a.houses_id = b.id", "left")
->where($params) ->where($params)
->group("houses_id")
->select(); ->select();
// echo Db::name($this->table)->getLastSql(); //echo Db::name($this->table)->getLastSql();
return $result; return $result;
} }
......
...@@ -304,6 +304,8 @@ class OReportModel extends Model ...@@ -304,6 +304,8 @@ class OReportModel extends Model
) ) as aaa ORDER BY `create_time` DESC limit $start_index,$pageSize"; ) ) as aaa ORDER BY `create_time` DESC limit $start_index,$pageSize";
$result = $this->db->query($sql); $result = $this->db->query($sql);
//echo $this->getLastSql();
return $result; return $result;
} }
......
...@@ -112,7 +112,7 @@ class OrderModel extends Model ...@@ -112,7 +112,7 @@ class OrderModel extends Model
->select();*/ ->select();*/
/* dump($params); /* dump($params);
dump($where_);*/ dump($where_);*/
$where_ = $where_ ." and " . $params; //$where_ = $where_ ." and " . $params;
$sql = "SELECT * FROM $sql = "SELECT * FROM
( (
( (
...@@ -136,7 +136,7 @@ class OrderModel extends Model ...@@ -136,7 +136,7 @@ class OrderModel extends Model
) )
) AS aaa"; ) AS aaa";
$result = $this->db_->query($sql); $result = $this->db_->query($sql);
// echo $this->db_->getLastSql(); //echo $this->db_->getLastSql();
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