Commit 28512de7 authored by zhuwei's avatar zhuwei

PC后台---业绩点击数字查看----报备详情接口数据补充

parent 83c1e93a
...@@ -548,20 +548,25 @@ class Performance extends Basic ...@@ -548,20 +548,25 @@ class Performance extends Basic
return $this->response("200", "success", $result["date"]); return $this->response("200", "success", $result["date"]);
} }
} }
//TODO 报备 //TODO 报备
public function followListPcInfo() public function followListPcInfo()
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
/*$params = array( // return 'ceshi';
//"id" => 80, /* $params = array(
//"type" => 1, //1表示个人业绩排行 2门店 3区域 "id" => 80,
"type" => 1, //1表示个人业绩排行 2门店 3区域
//"id" => 79, //"id" => 79,
//"type" => 2, //1表示个人业绩排行 2门店 3区域 //"type" => 2, //1表示个人业绩排行 2门店 3区域
"id" => 7, // "id" => 7,
"type" => 3, //1表示个人业绩排行 2门店 3区域 // "type" => 3, //1表示个人业绩排行 2门店 3区域
"start_time" => "2018-06-12", "start_time" => "2018-06-12",
"end_time" => "2018-06-19", "end_time" => "2018-06-19",
...@@ -587,6 +592,16 @@ class Performance extends Basic ...@@ -587,6 +592,16 @@ class Performance extends Basic
return $this->response("200", "success", $result["date"]); return $this->response("200", "success", $result["date"]);
} }
} }
// //TODO 新增商铺 // //TODO 新增商铺
public function housingResourcePcInfo() public function housingResourcePcInfo()
{ {
...@@ -666,5 +681,43 @@ class Performance extends Basic ...@@ -666,5 +681,43 @@ class Performance extends Basic
} }
} }
//TODO 团队人数 //TODO 团队人数
public function teamNumPcInfo()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
//"id" => 80,
//"type" => 1, //1表示个人业绩排行 2门店 3区域
//"id" => 79,
//"type" => 2, //1表示个人业绩排行 2门店 3区域
"id" => 7,
"type" => 3, //1表示个人业绩排行 2门店 3区域
"start_time" => "2018-06-12",
"end_time" => "2018-06-19",
"page_no" => 1,
"page_size" => 15
);*/
// $checkResult = $this->validate($params, "PerformanceValidate.verify");
// 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_->getUserResourceListPcInfo($params["id"],$params["type"], $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"]);
}
}
} }
...@@ -734,14 +734,25 @@ class PerformanceService ...@@ -734,14 +734,25 @@ class PerformanceService
return [ "code" => 200, "date" => $addHouseList ]; return [ "code" => 200, "date" => $addHouseList ];
} }
/**
* 报备
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function getFollowListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size) public function getFollowListPcInfo($id,$type, $start_time, $end_time, $page_no, $page_size)
{ {
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time); $params = $this->getAgentIdPcInfo($id, $type, $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,c.internal_title as house_title,c.shop_type"; $field = "a.id,a.user_name,a.predict_see_time,a.create_time,a.report_agent_name,c.internal_title as house_title,c.shop_type,e.store_name";
$reportList = $this->reportModel->getAddReportList($params, $field, $page_no, $page_size); $reportList = $this->reportModel->getAddReportListPcInfo($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"]);
} }
......
...@@ -634,6 +634,34 @@ class OReportModel extends Model ...@@ -634,6 +634,34 @@ class OReportModel extends Model
return $result; return $result;
} }
public function getAddReportListPcInfo($params, $field, $page_no, $page_size)
{
$where_ = [];
if (isset($params["agent_id"])) {
$where_["a.report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
}
if (isset($params["house_ids"])) {
$where_["b.house_id"] = array( "in", $params["house_ids"] );
}
$where_["a.status"] = 0;
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left")
->join('a_store e', 'a.report_store_id = e.id', 'left')
->where($where_)
->limit($page_size)
->page($page_no)
->select();
//echo Db::table($this->table)->getLastSql();
return $result;
}
/** /**
* @param $field * @param $field
* @param $params * @param $params
......
...@@ -546,8 +546,12 @@ Route::group('broker', [ ...@@ -546,8 +546,12 @@ Route::group('broker', [
'superviseList' => [ 'api_broker/Performance/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行list 'superviseList' => [ 'api_broker/Performance/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行list
'officialReceiptsList' => [ 'api_broker/Performance/officialReceiptsList', [ 'method' => 'POST|GET' ] ], //实收list 'officialReceiptsList' => [ 'api_broker/Performance/officialReceiptsList', [ 'method' => 'POST|GET' ] ], //实收list
'paylogListPcInfo' => [ 'api_broker/Performance/paylogListPcInfo', [ 'method' => 'POST|GET' ] ], //进场list 'paylogListPcInfo' => [ 'api_broker/Performance/paylogListPcInfo', [ 'method' => 'POST|GET' ] ], //
'marchInListPcInfo' => [ 'api_broker/Performance/marchInListPcInfo', [ 'method' => 'POST|GET' ] ], //进场list 'marchInListPcInfo' => [ 'api_broker/Performance/marchInListPcInfo', [ 'method' => 'POST|GET' ] ], //
'followListPcInfo' => [ 'api_broker/Performance/followListPcInfo', [ 'method' => 'POST|GET' ] ], //报备
'housingResourcePcInfo' => [ 'api_broker/Performance/housingResourcePcInfo', [ 'method' => 'POST|GET' ] ], //新增商铺
'userResourcePcInfo' => [ 'api_broker/Performance/userResourcePcInfo', [ 'method' => 'POST|GET' ] ], //新增客户
'teamNumPcInfo' => [ 'api_broker/Performance/teamNumPcInfo', [ 'method' => 'POST|GET' ] ], //团队人数
//user //user
......
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