Commit 5873a063 authored by clone's avatar clone

业绩监督执行列表

parent 5057c0e6
...@@ -388,4 +388,39 @@ class Performance extends Basic ...@@ -388,4 +388,39 @@ class Performance extends Basic
return $this->response("200", "success", $result["date"]); return $this->response("200", "success", $result["date"]);
} }
} }
/**
* 获取时间段进场数据
* @return \think\Response
*/
public function superviseList()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
$params = array(
"agent_id" => 78,
"start_time" => "2018-06-12",
"end_time" => "2018-06-20",
"page_no" => 1,
"page_size" => 15
);
$checkResult = $this->validate($params, "PerformanceValidate.verifyOther");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
//默认排序一周
$end_day = !empty($params["end_time"]) ? $params["end_time"] : date("Y-m-d", strtotime("-1 day"));
$start_day = !empty($params["start_time"]) ? $params["start_time"] : date("Y-m-d", strtotime("-7 day"));
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->superviseList($params["agent_id"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
return $this->response("200", "success", $result["date"]);
}
}
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace app\api_broker\service; namespace app\api_broker\service;
use app\model\AAgents; use app\model\AAgents;
use app\model\ASuperviseModel;
use app\model\GHouses; use app\model\GHouses;
use app\model\GHousesImgs; use app\model\GHousesImgs;
use app\model\OBargainModel; use app\model\OBargainModel;
...@@ -32,6 +33,7 @@ class PerformanceService ...@@ -32,6 +33,7 @@ class PerformanceService
private $marchInModel; private $marchInModel;
private $payLogModel; private $payLogModel;
private $gHousesImgModel; private $gHousesImgModel;
private $superviseModel;
public function __construct() public function __construct()
{ {
...@@ -46,6 +48,7 @@ class PerformanceService ...@@ -46,6 +48,7 @@ class PerformanceService
$this->marchInModel = new OMarchInModel(); $this->marchInModel = new OMarchInModel();
$this->payLogModel = new OPayLogModel(); $this->payLogModel = new OPayLogModel();
$this->gHousesImgModel = new GHousesImgs(); $this->gHousesImgModel = new GHousesImgs();
$this->superviseModel = new ASuperviseModel();
} }
...@@ -613,13 +616,14 @@ class PerformanceService ...@@ -613,13 +616,14 @@ class PerformanceService
$params = $this->getAgentId($agent_id, 2, $start_time, $end_time); $params = $this->getAgentId($agent_id, 2, $start_time, $end_time);
if (!$params) if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ]; return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.user_name,a.user_phone,a.predict_see_time,b.house_title"; $field = "a.id,a.user_name,a.user_phone,a.predict_see_time,b.house_title";
$reportList = $this->reportModel->getAddReportList($params, $field, $page_no, $page_size); $reportList = $this->reportModel->getAddReportList($params, $field, $page_no, $page_size);
foreach ($reportList as $key => $val) { foreach ($reportList as $key => $val) {
$reportList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]); $reportList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
} }
return [ "code" => 200, "date" => $reportList ]; return [ "code" => 200, "date" => $reportList ];
} }
/** /**
* 获取进场数据 * 获取进场数据
* @param $agent_id * @param $agent_id
...@@ -635,14 +639,15 @@ class PerformanceService ...@@ -635,14 +639,15 @@ class PerformanceService
$params = $this->getAgentId($agent_id, 2, $start_time, $end_time); $params = $this->getAgentId($agent_id, 2, $start_time, $end_time);
if (!$params) if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ]; return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,c.user_name,c.user_phone,c.predict_see_time,b.house_title"; $field = "a.id,c.user_name,c.user_phone,c.predict_see_time,b.house_title";
$addMarchInList = $this->marchInModel->getAddMarchInList($params, $field, $page_no, $page_size); $addMarchInList = $this->marchInModel->getAddMarchInList($params, $field, $page_no, $page_size);
//获取图片信息 //获取图片信息
foreach ($addMarchInList as $key => $val) { foreach ($addMarchInList as $key => $val) {
$addMarchInList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]); $addMarchInList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
} }
return [ "code" => 200, "date" => $addMarchInList ]; return [ "code" => 200, "date" => $addMarchInList ];
} }
/** /**
* 获取收款数据 * 获取收款数据
* @param $agent_id * @param $agent_id
...@@ -658,14 +663,15 @@ class PerformanceService ...@@ -658,14 +663,15 @@ class PerformanceService
$params = $this->getAgentId($agent_id, 2, $start_time, $end_time); $params = $this->getAgentId($agent_id, 2, $start_time, $end_time);
if (!$params) if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ]; return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,c.user_name,c.user_phone,c.predict_see_time,b.house_title"; $field = "a.id,c.user_name,c.user_phone,c.predict_see_time,b.house_title";
$payLogList = $this->payLogModel->getAddPayLogList($params, $field, $page_no, $page_size); $payLogList = $this->payLogModel->getAddPayLogList($params, $field, $page_no, $page_size);
//获取图片信息 //获取图片信息
foreach ($payLogList as $key => $val) { foreach ($payLogList as $key => $val) {
$payLogList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]); $payLogList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
} }
return [ "code" => 200, "date" => $payLogList ]; return [ "code" => 200, "date" => $payLogList ];
} }
/** /**
* 获取业绩数据 * 获取业绩数据
* @param $type * @param $type
...@@ -676,15 +682,40 @@ class PerformanceService ...@@ -676,15 +682,40 @@ class PerformanceService
* @param $page_size * @param $page_size
* @return array|false|\PDOStatement|string|\think\Collection * @return array|false|\PDOStatement|string|\think\Collection
*/ */
public function performanceList($type,$agent_id, $start_time, $end_time, $page_no, $page_size) public function performanceList($type, $agent_id, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentId($agent_id, $type, $start_time, $end_time); $params = $this->getAgentId($agent_id, $type, $start_time, $end_time);
if (!$params) if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ]; return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,b.name,c.store_name,d.district_name,a.scale_fee,a.create_time"; $field = "a.id,b.name,c.store_name,d.district_name,a.scale_fee,a.create_time";
$performanceList = $this->bargainModel->getAddBargainList($params, $field, $page_no, $page_size); $performanceList = $this->bargainModel->getAddBargainList($params, $field, $page_no, $page_size);
return [ "code" => 200, "date" => $performanceList ]; return [ "code" => 200, "date" => $performanceList ];
} }
/**
* 获取监督执行记录
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function superviseList($agent_id, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentId($agent_id, 2, $start_time, $end_time);
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.agent_id,a.agent_name,a.remark,a.img,a.address,a.create_time";
$where_["a.agent_id"] = $params["agent_id"];
$where_["a.create_time"] = $params["create_time"];
$superviseList = $this->superviseModel->findSuperviseList($page_no, $page_size, 'id desc', $field, $where_);
foreach ($superviseList as $k => $v) {
$superviseList[$k]['img'] = CK_IMG_URL . 'images/supervise/' . $v['img'];
}
return [ "code" => 200, "date" => $superviseList ];
}
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ class UWxInfo extends Model ...@@ -22,7 +22,7 @@ class UWxInfo extends Model
* 新增微信拉取用户信息 * 新增微信拉取用户信息
* @param $params * @param $params
* @return int|string * @return int|string
* @throws Exception * @throws Exception xx
*/ */
public function addWxInfo(array $params): int public function addWxInfo(array $params): int
{ {
......
...@@ -468,6 +468,7 @@ Route::group('broker', [ ...@@ -468,6 +468,7 @@ Route::group('broker', [
'marchInList' => [ 'api_broker/Performance/marchInList', [ 'method' => 'POST|GET' ] ], //进场list 'marchInList' => [ 'api_broker/Performance/marchInList', [ 'method' => 'POST|GET' ] ], //进场list
'paylogList' => [ 'api_broker/Performance/paylogList', [ 'method' => 'POST|GET' ] ], //收款list 'paylogList' => [ 'api_broker/Performance/paylogList', [ 'method' => 'POST|GET' ] ], //收款list
'performanceList' => [ 'api_broker/Performance/performanceList', [ 'method' => 'POST|GET' ] ], //业绩list 'performanceList' => [ 'api_broker/Performance/performanceList', [ 'method' => 'POST|GET' ] ], //业绩list
'superviseList' => [ 'api_broker/Performance/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行list
//user //user
'returnSearchCondition' => [ 'api_broker/User/returnSearchCondition', [ 'method' => 'get' ] ], //客户搜索条件 'returnSearchCondition' => [ 'api_broker/User/returnSearchCondition', [ 'method' => '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