Commit 03de5dbe authored by clone's avatar clone

注释

parent 9e751ecf
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\MyCenterService;
use think\Exception;
......@@ -12,8 +14,8 @@ use think\Request;
* Time : 下午1:34
* Intro:
*/
class MyCenter extends Basic{
class MyCenter extends Basic
{
private $service_;
public function __construct(Request $request = null)
......@@ -26,33 +28,30 @@ class MyCenter extends Basic{
* 我得个人中心
* @return \think\Response
*/
public function center(){
public function center()
{
$params = $this->params;
/* $params = array(
"agent_id" => 1
);*/
// if(!isset($params["agent_id"])){
// return $this->response("101","请求参数错误");
// }
/* $params = array(
"agent_id" => 1
);*/
if (empty($params['agent_id'])) {
if (empty($this->agentId)) {
return $this->response("101","请求参数错误");
return $this->response("101", "请求参数错误");
}
$agent_id = $this->agentId;
} else {
$agent_id = $params["agent_id"];
}
try{
try {
$result = $this->service_->center($agent_id);
if($result){
return $this->response("200","request success",$result);
}else{
return $this->response("200","request null");
if ($result) {
return $this->response("200", "request success", $result);
} else {
return $this->response("200", "request null");
}
}catch (Exception $exception){
return $this->response("101","request error, msg:" . $exception);
} catch (Exception $exception) {
return $this->response("101", "request error, msg:" . $exception);
}
}
......
......@@ -190,7 +190,7 @@ class Shop extends Basic
*/
public function getShopDetail()
{
header('Access-Control-Allow-Origin:*');
/*$params = array(
"id" => 445,
"site_area" => 3, //1.c端 3.b端
......
......@@ -27,6 +27,10 @@ class Statement extends Basic
$this->service_ = new StatementService();
}
/**
* 日报周报获取新增数据
* @return \think\Response
*/
public function dayStatement()
{
header('Access-Control-Allow-Origin:*');
......
......@@ -35,6 +35,7 @@ class StatementService
}
/**
* 获取日报周报数据统计 根据传入的经纪人id
* @param $agent_id
* @param $time_start
* @param $time_end
......@@ -69,6 +70,15 @@ class StatementService
return $this->selectStatement($conditions, $user_type, $store_id, $district_id);
}
/**
* 统计数据
* @param $conditions
* @param $user_type
* @param $store_id
* @param $district_id
* @return array
*/
private function selectStatement($conditions, $user_type, $store_id, $district_id)
{
......@@ -127,6 +137,13 @@ class StatementService
}
/**
* 获取门店业绩列表
* @param $conditions
* @param $agent_id
* @param $agent_name
* @return mixed
*/
private function getStoreList($conditions, $agent_id, $agent_name)
{
$conditions_ = $conditions;
......@@ -141,6 +158,12 @@ class StatementService
}
/**
* 获取区域业绩列表
* @param $conditions
* @param $district_id
* @return mixed
*/
private function getDistrictList($conditions, $district_id)
{
//根据门店统计本周人数和上周人数
......
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