Commit 54f3162a authored by zw's avatar zw

首页跟进

parent 236d1c0b
<?php
namespace app\app_broker\controller;
use app\api_broker\extend\Basic;
use app\model\UPhoneFollowPp;
use think\Request;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/5/23
* Time : 上午11:34
* Intro: 首页客户跟进和商铺跟进列表
*/
class HomePageLog extends Basic
{
private $uPhoneFollowUpModel;
function __construct(Request $request = null)
{
parent::__construct($request);
$this->uPhoneFollowUpModel = new UPhoneFollowPp();
}
/**
* 首页客户跟进
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function userFollowUpList()
{
$params = $this->params;
$params = array(
"start_time" => time(),
"end_time" => time() . " 23:59:59",
"name_or_phone" => "li",
"search_content" => "111",
"pageNo" => 1,
"pageSize" => 15
);
if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间');
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = "f.id,f.user_id,f.agent_id,f.type,f.content,f.create_time,a.name,a.img,b.store_name";
if (!empty($params["search_content"])) {
$where_["f.content"] = array( "like", "%" . trim($params['search_content']) . "%" );
}
if (!empty($params["start_time"]) && !empty($params["end_time"])) {
$where_["f.create_time"] = array( 'between', array( $params["start_time"], $params["end_time"] ));
}
if (!empty($params["name_or_phone"])) {
$where_["u.user_phone|u.user_name"] = array( "like", '%name_or_phone%' );
}
$join = [
[ 'a_agents a', 'a.id=f.agent_id', 'left' ],
[ 'u_users u', 'u.id=f.user_id', 'left' ],
[ 'a_store b', 'b.id=a.store_id', 'left' ],
];
$order = "f.id desc";
$result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_,"");
return $this->response("200","request success",$result);
}
}
\ No newline at end of file
......@@ -442,6 +442,9 @@ Route::group('broker', [
'getAgentsResidueNumList' => ['api_broker/LookShop/getAgentsResidueNumList', [ 'method' => 'get' ] ], //剩余铺数列表
'setAgentLookNum' => ['api_broker/LookShop/setAgentLookNum', [ 'method' => 'post' ] ], //设置经纪人的看铺数量
//首页跟进记录
'userFollowUpList' => ['api_broker/HomePageLog/userFollowUpList', [ 'method' => 'post|get' ] ], //设置经纪人的看铺数量
]);
......
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