Commit 630af18f authored by zw's avatar zw

业绩

parent a4a5360c
<?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\PerformanceService;
use think\Request;
/**
......@@ -12,16 +13,23 @@ use think\Request;
*/
class Performance extends Basic{
private $service_;
function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new PerformanceService();
}
public function selectPerformanceByTime(){
$params = $this->params;
$params = array(
"agent_id" => 1,
"agent_id" => 1,
"agent_id" => 1,
"type" => 1, //1表示个人业绩排行 2门店 3区域
);
if(!isset($params["agent_id"]) || !isset($params["type"])){
return $this->response("101","请求参数错误");
}
$this->service_->totalAgent($params["agent_id"],$params["type"]);
}
}
<?php
namespace app\api_broker\service;
use app\model\TAgentTotalModel;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/22
* Time : 上午10:37
* Intro:
*/
class PerformanceService
{
private $totalModel;
public function __construct()
{
$this->totalModel = new TAgentTotalModel();
}
public function totalAgent($agent_id, $type)
{
$where_ = [];
$yesterday = date("Y-m-d", strtotime("-1 day"));
$end_day = date("Y-m-d", strtotime("-7 day"));
$where_['total_time'] = array( 'between', array( $yesterday, $end_day ) );
switch ($type){
case 1:
break;
case 2:
break;
case 3:
break;
default:
}
}
}
\ No newline at end of file
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