Commit 571db288 authored by zw's avatar zw Committed by hujun

报备列表

parent 72ece921
......@@ -5,6 +5,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\ReportService;
use app\model\FollowUpLogModel;
use app\model\OReportModel;
use think\Exception;
/**
......@@ -18,12 +19,14 @@ class Report extends Basic
{
private $service_;
private $fulModel;
private $oReportModel;
public function __construct($request = null)
{
parent::__construct($request);
$this->service_ = new ReportService();
$this->fulModel = new FollowUpLogModel();
$this->oReportModel = new OReportModel();
}
/**
......@@ -76,6 +79,39 @@ class Report extends Basic
}
/**
* 获取报备列表
* @return \think\Response
*/
public function reportList(){
/* $params = array(
"agent_id" =>1,
);*/
$params = $this->params;
if(!isset($params["agent_id"])){
return $this->response("101", "请求参数错误");
}
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = $this->oReportModel->selectReportList($field,$params);
if(count($result) > 0){
foreach ($result as $k=>$v){
$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
}
}
return $this->response("200","request success",$result);
}
/**
* 新增跟进
......
......@@ -216,7 +216,7 @@ class Shop extends Basic
if ($params['site_area'] == 1 && isset($params['user_id'])) {
$attention["user_id"] = array( "eq", $params['user_id'] );
$attention["house_id"] = array( "eq", $params["id"] );
$attention["is_del"] = array( "eq", 0 );;
$attention["is_del"] = array( "eq", 0 );
$attResult = $this->attentionModel->getAttentionByUserIdAndHouseId($attention);
if (count($attResult) > 0)
$result ["attention"] = $attResult["id"];
......
......@@ -72,4 +72,26 @@ class OReportModel extends Model
->where($where_)
->select();
}
/**
* @param string $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function selectReportList($filed = "id", $params){
$where_ = [];
if (isset($params["report_agent_id"])) {
$where_["a.report_agent_id"] = $params["report_agent_id"];
}
$where_["a.status"] = 0;
$where_["b.is_del"] = 0;
return $this->db
->field($filed)
->alias("a")
->join("o_order b","a.id= b.f_id","left")
->where($where_)
->select();
}
}
\ No newline at end of file
......@@ -248,6 +248,27 @@ Route::group('broker', [
'collectingBill' => [ 'api_broker/OrderLog/collectingBill', [ 'method' => 'get|post' ] ],
'refund' => [ 'api_broker/OrderLog/refund', [ 'method' => 'get|post' ] ],
'bargain' => [ 'api_broker/OrderLog/bargain', [ 'method' => 'get|post' ] ],
'statusBargain' => [ 'api_broker/OrderLog/statusBargain', [ 'method' => 'get|post' ] ],
'login' => [ 'api_broker/Broker/login', [ 'method' => 'post' ] ], //经纪人登陆
'editAgent' => [ 'api_broker/Broker/editAgent', [ 'method' => 'post' ] ], //经纪人修改密码
'uploadHeadImg' => [ 'api_broker/Broker/uploadHeadImg', [ 'method' => 'post' ] ], //经纪人上传头像
'editClient' => [ 'api_broker/Client/editClient', [ 'method' => 'get|post' ] ],//添加和编辑客户
'getBroker' => [ 'api_broker/broker/getBroker',['method'=>'get']],//获取经纪人列表
'labelEdit' => [ 'api_broker/label/index',['method'=>'get|post']], //编辑标签
'getLabelsList' => [ 'api_broker/label/getLabelsList',['method'=>'get']], //标签列表
'add_phone_follow_up' => [ 'api_broker/broker/add_phone_follow_up',['method'=>'get|post']],//新增-客户电话跟进
'useraction_search' => [ 'api_broker/broker/useraction_search',['method'=>'get|post']],//新增-客户电话跟进
'user_search' => [ 'api_broker/broker/user_search',['method'=>'get|post']],//客户搜索
'bindAXB' => [ 'api_broker/CellPhone/bindAXB', [ 'method' => 'post' ] ],//隐私号码
'agentsUnBind' => [ 'api_broker/CellPhone/agentsUnBind', [ 'method' => 'post' ] ],//解除绑定关系
'updateBindAXB' => ['api_broker/CellPhone/updateBindAXB', [ 'method' => 'post' ] ], //更新绑定关系隐私号码
//商铺
'getShopList' => ['api_broker/Shop/getShopList', [ 'method' => 'get|post' ] ],
'getShopDetail' => ['api_broker/Shop/getShopDetail', [ 'method' => 'get' ] ],
'reportList' => ['api_broker/Report/reportList', [ 'method' => 'get' ] ],
]);
Route::group('task',[
......
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