Commit f6e74b16 authored by zhuwei's avatar zhuwei

日报修改

parent e7f37f0e
...@@ -35,8 +35,8 @@ class Statement extends Basic ...@@ -35,8 +35,8 @@ class Statement extends Basic
{ {
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
/*$params = array( /* $params = array(
"agent_id" => 10015, "agent_id" => 5739,
"time_start" => date("Y-m-d", time()), "time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59", "time_end" => date("Y-m-d", time()) . " 23:59:59",
);*/ );*/
......
...@@ -5,6 +5,7 @@ namespace app\api_broker\service; ...@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use app\model\AAgents; use app\model\AAgents;
use app\model\FollowUpLogModel; use app\model\FollowUpLogModel;
use app\model\GHouses; use app\model\GHouses;
use app\model\OBargainModel;
use app\model\OReportModel; use app\model\OReportModel;
use app\model\Users; use app\model\Users;
...@@ -129,10 +130,42 @@ class StatementService ...@@ -129,10 +130,42 @@ class StatementService
$result["agent_total"] = $agent_total; $result["agent_total"] = $agent_total;
$result["house_num"] = $this->houseModel->getAddHouseNumByAgentId($conditions); $result["house_num"] = $this->houseModel->getAddHouseNumByAgentId($conditions);
//dump($conditions);
$result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions); $result["user_num"] = $this->userModel->getAddUserNumByAgentId($conditions);
//$result["follow_up_num"] = $this->followUpModel->getAddFollowUpNumByAgentId($conditions); //$result["follow_up_num"] = $this->followUpModel->getAddFollowUpNumByAgentId($conditions);
$result["follow_up_num"] = $this->reportModel->getAddFollowUpNumByAgentId($conditions); $result["follow_up_num"] = $this->reportModel->getAddFollowUpNumByAgentId($conditions);
//本月业绩
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", strtotime("-1 day"));;
$where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$obargain = new OBargainModel();
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["performance_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//本周业绩
$start_time = date("Y-m-d", strtotime("-7 day"));
$where_['create_time'] = ['between', [$start_time . " 00:00:00", $end_time . " 23:59:59"]];
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["performance_week"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//本月完成单数
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", strtotime("-1 day"));
$where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
$result["bargain_sum"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//客源
$addUserNum = $this->userModel->getAddUserNum($where_);
$result["add_user_num"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
//todo //todo
$result["store_list"] = $store_list; $result["store_list"] = $store_list;
$result["district_list"] = $district_list; $result["district_list"] = $district_list;
......
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