Commit 5ae1020a authored by hujun's avatar hujun

成交报告id搜索

parent 135963bb
...@@ -39,13 +39,14 @@ class Bargain extends Basic ...@@ -39,13 +39,14 @@ class Bargain extends Basic
"is_my_correlation" => 1, //是否与我相关 0全部 1与我相关 "is_my_correlation" => 1, //是否与我相关 0全部 1与我相关
// "keyword" => "17717536291", // "keyword" => "17717536291",
"page_no" => 1, "page_no" => 1,
"page_size" => 10 "page_size" => 10,
"bargain_id" =>10
);*/ );*/
$checkResult = $this->validate($params, "BargainValidate.bargainList"); $checkResult = $this->validate($params, "BargainValidate.bargainList");
if (true !== $checkResult) { if (true !== $checkResult) {
return $this->response("101", $checkResult); return $this->response("10111", $checkResult);
} }
$pageNo = empty($params["page_no"]) ? 1 : $params["page_no"]; $pageNo = empty($params["page_no"]) ? 1 : $params["page_no"];
$pageSize = empty($params["page_size"]) ? 15 : $params["page_size"]; $pageSize = empty($params["page_size"]) ? 15 : $params["page_size"];
...@@ -53,6 +54,7 @@ class Bargain extends Basic ...@@ -53,6 +54,7 @@ class Bargain extends Basic
$status = $params["status"]; $status = $params["status"];
$is_my_correlation = $params["is_my_correlation"]; $is_my_correlation = $params["is_my_correlation"];
$keyword = empty($params["keyword"]) ? "" : $params["keyword"]; $keyword = empty($params["keyword"]) ? "" : $params["keyword"];
$bargain_id = empty($params['bargain_id']) ? '':$params['bargain_id'];
/*业务员不允许点击查看全部成交报告 start*/ /*业务员不允许点击查看全部成交报告 start*/
$agent_field = "a.level"; $agent_field = "a.level";
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, [ "agent_id" => $submit_agent_id ]); $agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, [ "agent_id" => $submit_agent_id ]);
...@@ -62,7 +64,7 @@ class Bargain extends Basic ...@@ -62,7 +64,7 @@ class Bargain extends Basic
} }
/*业务员不允许点击查看全部成交报告 end*/ /*业务员不允许点击查看全部成交报告 end*/
$result = $this->service_->getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword); $result = $this->service_->getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id);
return $this->response("200", "success", $result); return $this->response("200", "success", $result);
} }
......
...@@ -24,7 +24,7 @@ class BargainService ...@@ -24,7 +24,7 @@ class BargainService
* @param $keyword * @param $keyword
* @return array|false|\PDOStatement|string|\think\Collection * @return array|false|\PDOStatement|string|\think\Collection
*/ */
public function getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword) public function getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id)
{ {
$condition = []; $condition = [];
...@@ -57,6 +57,10 @@ class BargainService ...@@ -57,6 +57,10 @@ class BargainService
$condition["keyword"] = $keyword; $condition["keyword"] = $keyword;
} }
if (!empty($bargain_id)) {
$condition["id"] = $bargain_id;
}
$bargainModel = new OBargainModel(); $bargainModel = new OBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone, $filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone,
b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,d.internal_title,d.internal_address,b.id as report_id"; b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,d.internal_title,d.internal_address,b.id as report_id";
......
...@@ -258,6 +258,10 @@ class OBargainModel extends Model ...@@ -258,6 +258,10 @@ class OBargainModel extends Model
$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"] . "%" );
} }
if (isset($params["id"])) {
$where_["a.id"] = $params["id"];
}
$where_["b.status"] = 0; $where_["b.status"] = 0;
$where_["c.is_del"] = 0; $where_["c.is_del"] = 0;
$result = $this->db_ $result = $this->db_
......
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