Commit 78b18c21 authored by zw's avatar zw

带看列表bug

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