Commit 4e64ea8c authored by zhuwei's avatar zhuwei

调整 搜索成交报告id

parent f3994309
......@@ -114,16 +114,16 @@ class Bargain extends Basic
public function bargainListSearchBargainId()
{
$params = $this->params;
/* $params = array(
"submit_agent_id" => 93,
"status" => 1,//0全部 1未结单 2已结单 3 撤销审核 4已撤销
"is_my_correlation" => 1, //是否与我相关 0全部 1与我相关
"keyword" => "17717536291",
"page_no" => 1,
"page_size" => 10,
"bargain_id" =>10
);*/
/*
AuthToken:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo1Nzc1LCJuYW1lIjoiXHU2ZDRiXHU4YmQ1MiIsInBob25lIjoiMTU2MDE2NTIzNTIiLCJsZXZlbCI6MjB9LCJ0aW1lU3RhbXBfIjoxNTU2MDc0NjY1fQ.EmHCH_QtMdymkAbYSLBGJ6q2-DUtrcv0ngXBDAKlMU4
is_my_correlation:0
keyword:288
page_no:1
page_size:15
status:5
submit_agent_id:5775
type:3
*/
$checkResult = $this->validate($params, "BargainValidate.bargainList");
if (true !== $checkResult) {
......@@ -136,16 +136,17 @@ class Bargain extends Basic
$is_my_correlation = $params["is_my_correlation"];
$keyword = empty($params["keyword"]) ? "" : $params["keyword"];
$bargain_id = empty($params['bargain_id']) ? '':$params['bargain_id'];
$type = empty($params['type']) ? '':$params['type'];
/*业务员不允许点击查看全部成交报告 start*/
$agent_field = "a.level";
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, [ "agent_id" => $submit_agent_id ]);
if(($agent_res[0]['level'] == 10) && ($is_my_correlation == 0)){
return $this->response("101", "暂无权限!2");
return $this->response("101", "暂无权限!");
}
/*业务员不允许点击查看全部成交报告 end*/
$result = $this->service_->getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id);
$result = $this->service_->getBargainListV2($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id,$type);
return $this->response("200", "success", $result);
}
......
......@@ -74,6 +74,59 @@ class BargainService
return $convertResult;
}
public function getBargainListV2($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id,$type)
{
$condition = [];
if ($is_my_correlation == 1) {
$aService = new VerifyService();
$ids = $aService->getAgentsByAgentId($submit_agent_id);
$condition["ids"] = $ids;
} else {
$condition["father_id"] = 0;
}
switch ($status) {
case 1:
$condition["account_statement"] = 0;
break;
case 2:
$condition["account_statement"] = 1;
break;
case 3:
$condition["status"] = 20;
break;
case 4:
$condition["status"] = 21;
break;
case 5://调账->搜成交报告 不包括 待撤销和已撤销
$condition["status"] = array('not in','20,21');
break;
default:
}
if (!empty($keyword)) {
$condition["keyword"] = $keyword;
}
if (!empty($bargain_id)) {
$condition["id"] = $bargain_id;
}
if (!empty($type)) {
$condition["type"] = $type;
}
$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,
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";
$result = $bargainModel->selectBargainList($filed, $condition, $pageNo, $pageSize);
$convertResult ["total"] = count($result);
$convertResult ["result"] = $this->convert($is_my_correlation, $result);
return $convertResult;
}
private function convert($is_my_correlation, $result)
{
$sortResult = [];
......
......@@ -260,7 +260,6 @@ class OBargainModel extends Model
if (!isset($params["type"]) && isset($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"];
......
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