Commit 5873a063 authored by clone's avatar clone

业绩监督执行列表

parent 5057c0e6
......@@ -388,4 +388,39 @@ class Performance extends Basic
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 @@
namespace app\api_broker\service;
use app\model\AAgents;
use app\model\ASuperviseModel;
use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\OBargainModel;
......@@ -32,6 +33,7 @@ class PerformanceService
private $marchInModel;
private $payLogModel;
private $gHousesImgModel;
private $superviseModel;
public function __construct()
{
......@@ -46,6 +48,7 @@ class PerformanceService
$this->marchInModel = new OMarchInModel();
$this->payLogModel = new OPayLogModel();
$this->gHousesImgModel = new GHousesImgs();
$this->superviseModel = new ASuperviseModel();
}
......@@ -620,6 +623,7 @@ class PerformanceService
}
return [ "code" => 200, "date" => $reportList ];
}
/**
* 获取进场数据
* @param $agent_id
......@@ -643,6 +647,7 @@ class PerformanceService
}
return [ "code" => 200, "date" => $addMarchInList ];
}
/**
* 获取收款数据
* @param $agent_id
......@@ -666,6 +671,7 @@ class PerformanceService
}
return [ "code" => 200, "date" => $payLogList ];
}
/**
* 获取业绩数据
* @param $type
......@@ -676,7 +682,7 @@ class PerformanceService
* @param $page_size
* @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);
......@@ -687,4 +693,29 @@ class PerformanceService
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
* 新增微信拉取用户信息
* @param $params
* @return int|string
* @throws Exception
* @throws Exception xx
*/
public function addWxInfo(array $params): int
{
......
......@@ -468,6 +468,7 @@ Route::group('broker', [
'marchInList' => [ 'api_broker/Performance/marchInList', [ 'method' => 'POST|GET' ] ], //进场list
'paylogList' => [ 'api_broker/Performance/paylogList', [ 'method' => 'POST|GET' ] ], //收款list
'performanceList' => [ 'api_broker/Performance/performanceList', [ 'method' => 'POST|GET' ] ], //业绩list
'superviseList' => [ 'api_broker/Performance/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行list
//user
'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