Commit 26f2bee3 authored by clone's avatar clone

成交报告搜索

parent 7181ad3b
...@@ -657,14 +657,17 @@ class OrderLog extends Basic ...@@ -657,14 +657,17 @@ class OrderLog extends Basic
/* $params = array( /* $params = array(
"submit_agent_id" => 1, "submit_agent_id" => 1,
"keyword" => "17717536291", "keyword" => "17717536291",
"type" => 1,//1商铺id 2商铺地址 3成交报告id 4带看id 5客户id
"page_no" => 1, "page_no" => 1,
"page_size" => 15 "page_size" => 15
);*/ );*/
if (!isset($params["submit_agent_id"]) || !isset($params["keyword"])) { if (!isset($params["submit_agent_id"]) || !isset($params["keyword"]) || !isset($params["type"]) ) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
if(($params["type"] == 1 || $params["type"] == 3 || $params["type"] == 4 || $params["type"] == 7) && !preg_match("/^\d*$/",$params["search_keyword"])){
return $this->response("101", "输入的搜索内容错误");
}
try { try {
$result = $this->service_->getBargainList($params); $result = $this->service_->getBargainList($params);
if (count($result) > 0) { if (count($result) > 0) {
......
...@@ -1369,7 +1369,6 @@ class OrderLogService ...@@ -1369,7 +1369,6 @@ class OrderLogService
$ids = $aService->getAgentsByAgentId($agent_id); $ids = $aService->getAgentsByAgentId($agent_id);
$params["ids"] = $ids; $params["ids"] = $ids;
$bargainModel = new OBargainModel(); $bargainModel = new OBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.commission,a.agent_id,a.create_time,b.user_phone,b.user_name,b.user_id,c.id as order_id, $filed = "a.id,a.father_id,a.house_number,a.commission,a.agent_id,a.create_time,b.user_phone,b.user_name,b.user_id,c.id as order_id,
d.id as house_id,d.internal_title,d.internal_address"; d.id as house_id,d.internal_title,d.internal_address";
......
...@@ -257,10 +257,28 @@ class OBargainModel extends Model ...@@ -257,10 +257,28 @@ class OBargainModel extends Model
$where_["a.father_id"] = $params["father_id"]; $where_["a.father_id"] = $params["father_id"];
} }
if (isset($params["keyword"])) { if (!isset($params["type"]) && isset($params["keyword"])) {
$where_["b.user_phone|b.user_name|d.internal_address"] = array( "like", "%" . $params["keyword"] . "%" ); $where_["b.user_phone|b.user_name|d.internal_address"] = array( "like", "%" . $params["keyword"] . "%" );
} }
switch ((int)$params["type"]){ //1商铺id 2商铺地址 3成交报告id 4带看id 5客户id
case 1:
$where["d.id"] = $params["keyword"];
break;
case 2:
$where["d.internal_address"] = array("like" , "%" . trim($params['keyword']) . "%");
break;
case 3:
$where["a.id"] = $params["keyword"];
break;
case 4:
$where["c.id"] = $params["keyword"];
break;
case 5:
$where["b.user_id"] = $params["keyword"];
break;
}
if (isset($params["id"])) { if (isset($params["id"])) {
$where_["a.id"] = $params["id"]; $where_["a.id"] = $params["id"];
} }
......
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