Commit d9506d69 authored by zhuwei's avatar zhuwei

pc后台业绩修改

parent acae14ae
...@@ -77,10 +77,8 @@ class Performance extends Basic ...@@ -77,10 +77,8 @@ class Performance extends Basic
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time()); $end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ; $father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
//todo 业绩查询目前分三种情况
$search_time_type = $this->getSearchTimeType($start_day,$end_day);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$search_time_type); $list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id);
//dump($list); //dump($list);
if (count($list) > 0) { if (count($list) > 0) {
$result["list"] = $list['list']; $result["list"] = $list['list'];
...@@ -105,9 +103,8 @@ class Performance extends Basic ...@@ -105,9 +103,8 @@ class Performance extends Basic
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
// $params = array( // $params = array(
// "type" => 2, //1表示个人业绩排行 2门店 3区域 // "start_day" => '2018-08-08',
// "father_id" => 4, // "end_day" => '2018-08-08',
// // "start_day" =>"",
// ); // );
$params["type"] = 2; $params["type"] = 2;
...@@ -118,11 +115,8 @@ class Performance extends Basic ...@@ -118,11 +115,8 @@ class Performance extends Basic
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time()); $start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ; $father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
//todo 业绩查询目前分三种情况
$search_time_type = $this->getSearchTimeType($start_day,$end_day);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$search_time_type); $list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id);
//dump($list);
if (count($list) > 0) { if (count($list) > 0) {
$result["list"] = $list['list']; $result["list"] = $list['list'];
$result["total"] = $list['total']; $result["total"] = $list['total'];
...@@ -161,10 +155,7 @@ class Performance extends Basic ...@@ -161,10 +155,7 @@ class Performance extends Basic
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time()); $start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ; $father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
//todo 业绩查询目前分三种情况 $list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id);
$search_time_type = $this->getSearchTimeType($start_day,$end_day);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$search_time_type);
//dump($list); //dump($list);
if (count($list) > 0) { if (count($list) > 0) {
$result["list"] = $list['list']; $result["list"] = $list['list'];
......
...@@ -51,7 +51,7 @@ class PerformanceService ...@@ -51,7 +51,7 @@ class PerformanceService
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function totalAgent($type, $yesterday, $end_day,$pageNo,$pageSize,$father_id,$search_time_type) public function totalAgent($type, $yesterday, $end_day,$father_id)
{ {
$where_ = []; $where_ = [];
$where_['total_time'] = array( 'between', array( $end_day, $yesterday ) ); $where_['total_time'] = array( 'between', array( $end_day, $yesterday ) );
...@@ -63,37 +63,19 @@ class PerformanceService ...@@ -63,37 +63,19 @@ class PerformanceService
} }
} }
//todo 成交报告数 bargain_sum $where_ = [];
//todo 成交报告数其他 bargain_sum $where_['a.create_time'] = array( 'between', array( $end_day . " 00:00:00", $yesterday . " 23:59:59" ) );
//todo 收款数 paylog
//todo 进场数 march_in_num $field = "b.id as agent_id,b.store_id,b.district_id,sum(a.scale_fee) as performance_total";
//todo 报备数 look_at_num
//todo 新增商铺数 add_house_num
//todo 新增客户数 add_user_num
//todo 团队人数 team_num
$field = "
agent_id,
store_id,
district_id,sum(performance) as performance_total,
sum(bargain_sum) as bargain_sum_total,
sum(bargain_sum) as bargain_sum_total,
sum(paylog) as paylog_total,
sum(march_in_num) as march_in_num_total,
sum(look_at_num) as look_at_num_total,
sum(add_house_num) as add_house_num_total,
sum(add_user_num) as add_user_num_total
";
$order = "performance_total desc"; $order = "performance_total desc";
//dump($where_);
//dump($type); $result = $this->bargainModel->getTotalByAgentId($field, $where_, $type, $order);
$result = $this->totalModel->getTotalByAgentIdPage($pageNo,$pageSize,$field, $where_, $type, $order);
$arr = []; $arr = [];
$total = $this->totalModel->getTotalByAgentIdCount($field, $where_, $type, $order); // $total = $this->totalModel->getTotalByAgentIdCount($field, $where_, $type, $order);
// $field = "a.name,a.img,b.store_name,c.district_name";
$field = "a.name,a.img,b.store_name,c.district_name"; $field = "a.name,a.img,b.store_name,c.district_name";
//dump($result);
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
switch ($type) { switch ($type) {
...@@ -106,93 +88,42 @@ class PerformanceService ...@@ -106,93 +88,42 @@ class PerformanceService
$value["store_name"] = $info[0]["store_name"]; $value["store_name"] = $info[0]["store_name"];
$value["district_name"] = $info[0]["district_name"]; $value["district_name"] = $info[0]["district_name"];
//todo 1.今天之前,不包括今天
//todo 2.今天之前,包括今天
//todo 3.就只查询今天
if($search_time_type != 1){//如果不等于1,说明需要计算当天的数据,用不用再说
//todo 计算当日业绩 performance_total //todo 计算当日业绩 performance_total
$where_ = []; $where_ = [];
$time = date("Y-m-d", time());
//$where_["district_id"] = $district_id; //$where_["district_id"] = $district_id;
$where_["agent_id"] = $value["agent_id"]; $where_["agent_id"] = $value["agent_id"];
$where_['total_time'] = array( 'between', array( $time . " 00:00:00", $time . " 23:59:59" ) ); $where_['create_time'] = array( 'between', array( $end_day . " 00:00:00", $yesterday . " 23:59:59" ) );
$obargain = new OBargainModel(); $obargain = new OBargainModel();
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收 //dump($where_);
if($search_time_type == 2){//如果等于2,说明需要把今天之前的数据跟今天的数据合并起来
//dump($search_time_type);
//dump('如果等于2,说明需要把今天之前的数据跟今天的数据合并起来');
$performance_total = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$value["performance_total"] = $value["performance_total"] + $performance_total;
}else{
//dump($search_time_type);
//dump('只查询今天的数据');
$value["performance_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
}
//todo 计算当日成交单数 bargain_sum //todo 计算当日成交单数 bargain_sum
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收 $performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
$value["bargain_sum_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
if($search_time_type == 2){
$bargain_sum_total = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$value["bargain_sum_total"] = $value["bargain_sum_total"] + $bargain_sum_total;
}else{
$value["bargain_sum_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
}
//todo 计算当日收款数 paylog //todo 计算当日收款数 paylog
$receivedSum = $this->bargainModel->getAddBargainNum($where_, 2);//1表示业绩 2表示实收 $receivedSum = $this->bargainModel->getAddBargainNum($where_, 2);//1表示业绩 2表示实收
$value["paylog_total"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
if($search_time_type == 2){
$paylog_total = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
$value["paylog_total"] = $value["paylog_total"] + $paylog_total;
}else{
$value["paylog_total"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
}
//todo 计算当日进场数 march_in_num //todo 计算当日进场数 march_in_num
$addMarchInNum = $this->marchInModel->getAddMarchInNum($where_); $addMarchInNum = $this->marchInModel->getAddMarchInNum($where_);
$value["march_in_num_total"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
if($search_time_type == 2){
$march_in_num_total = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$value["march_in_num_total"] = $value["march_in_num_total"] + $march_in_num_total;
}else{
$value["march_in_num_total"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
}
//todo 计算当日报备数 look_at_num //todo 计算当日报备数 look_at_num
$reportNum = $this->reportModel->getAddReportNum($where_); $reportNum = $this->reportModel->getAddReportNum($where_);
$value["look_at_num_total"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
if($search_time_type == 2){
$look_at_num_total = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$value["look_at_num_total"] = $value["look_at_num_total"] + $look_at_num_total;
}else{
$value["look_at_num_total"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
}
//todo 计算当日新增商铺数 add_house_num //todo 计算当日新增商铺数 add_house_num
$addHouseNum = $this->houseModel->getAddHouseNum($where_); $addHouseNum = $this->houseModel->getAddHouseNum($where_);
$value["add_house_num_total"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
if($search_time_type == 2){
$add_house_num_total = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
$value["add_house_num_total"] = $value["add_house_num_total"] + $add_house_num_total;
}else{
$value["add_house_num_total"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
}
//todo 计算当日新增客户数 add_user_num //todo 计算当日新增客户数 add_user_num
$addUserNum = $this->userModel->getAddUserNum($where_); $addUserNum = $this->userModel->getAddUserNum($where_);
if($search_time_type == 2){ $result["add_user_num_total"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
$add_user_num_total = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
$value["add_user_num_total"] = $value["add_user_num_total"] + $add_user_num_total;
}else{
$result["add_user_num_total"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
}
}
array_push($arr, $value); array_push($arr, $value);
} }
...@@ -207,17 +138,16 @@ class PerformanceService ...@@ -207,17 +138,16 @@ class PerformanceService
$value["store_name"] = $info[0]["store_name"]; $value["store_name"] = $info[0]["store_name"];
$value["district_name"] = $info[0]["district_name"]; $value["district_name"] = $info[0]["district_name"];
} }
//计算门店人数 //计算门店人数
$params = []; $params = [];
$params['store_id'] = $value["store_id"]; $params['store_id'] = $value["store_id"];
$params["status"] = 0; //只查询正常状态的经纪人 $params["status"] = 0; //只查询正常状态的经纪人
$value["team_num"] = $this->agentModel->getAgentsCountByStoreId($params); $value["team_num"] = $this->agentModel->getAgentsCountByStoreId($params);
if($search_time_type != 1) {//如果不等于1,说明需要计算当天的数据,用不用再说
//查询总监下面门店的所有经纪人 //查询总监下面门店的所有经纪人
$params = []; $params = [];
$params["store_id"] = $value["store_id"]; $params['store_id'] = $value["store_id"];
$params["status"] = 0; //只查询正常状态的经纪人 $params["status"] = 0; //只查询正常状态的经纪人
$agentsArr = $this->agentModel->getAgentsByStoreId($params); $agentsArr = $this->agentModel->getAgentsByStoreId($params);
$agent_total = count($agentsArr); $agent_total = count($agentsArr);
...@@ -231,99 +161,60 @@ class PerformanceService ...@@ -231,99 +161,60 @@ class PerformanceService
//todo 计算当日业绩 performance_total //todo 计算当日业绩 performance_total
$where_ = []; $where_ = [];
$time = date("Y-m-d", time());
//$where_["district_id"] = $district_id; //$where_["district_id"] = $district_id;
$where_["agent_id"] = array( "in", $agentIds ); $where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $time . " 04:00:00", $time . " 23:59:59" ) ); $where_['create_time'] = array( 'between', array( $end_day . " 00:00:00", $yesterday . " 23:59:59" ) );
$obargain = new OBargainModel(); $obargain = new OBargainModel();
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收 //dump($where_);
if($search_time_type == 2){//如果等于2,说明需要把今天之前的数据跟今天的数据合并起来
//dump($search_time_type);
//dump('如果等于2,说明需要把今天之前的数据跟今天的数据合并起来');
$performance_total = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$value["performance_total"] = $value["performance_total"] + $performance_total;
}else{
//dump($search_time_type);
//dump('只查询今天的数据');
$value["performance_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
}
//todo 计算当日成交单数 bargain_sum //todo 计算当日成交单数 bargain_sum
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收 $performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
if($search_time_type == 2){ $value["bargain_sum_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$bargain_sum_total = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$value["bargain_sum_total"] = $value["bargain_sum_total"] + $bargain_sum_total;
}else{
$value["bargain_sum_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
}
//todo 计算当日收款数 paylog //todo 计算当日收款数 paylog
$receivedSum = $this->bargainModel->getAddBargainNum($where_, 2);//1表示业绩 2表示实收 $receivedSum = $this->bargainModel->getAddBargainNum($where_, 2);//1表示业绩 2表示实收
if($search_time_type == 2){ $value["paylog_total"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
$paylog_total = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
$value["paylog_total"] = $value["paylog_total"] + $paylog_total;
}else{
$value["paylog_total"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
}
//todo 计算当日进场数 march_in_num //todo 计算当日进场数 march_in_num
$addMarchInNum = $this->marchInModel->getAddMarchInNum($where_); $addMarchInNum = $this->marchInModel->getAddMarchInNum($where_);
if($search_time_type == 2){ $value["march_in_num_total"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$march_in_num_total = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$value["march_in_num_total"] = $value["march_in_num_total"] + $march_in_num_total;
}else{
$value["march_in_num_total"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
}
//todo 计算当日报备数 look_at_num //todo 计算当日报备数 look_at_num
$reportNum = $this->reportModel->getAddReportNum($where_); $reportNum = $this->reportModel->getAddReportNum($where_);
if($search_time_type == 2){ $value["look_at_num_total"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$look_at_num_total = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$value["look_at_num_total"] = $value["look_at_num_total"] + $look_at_num_total;
}else{
$value["look_at_num_total"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
}
//todo 计算当日新增商铺数 add_house_num //todo 计算当日新增商铺数 add_house_num
$addHouseNum = $this->houseModel->getAddHouseNum($where_); $addHouseNum = $this->houseModel->getAddHouseNum($where_);
if($search_time_type == 2){ $value["add_house_num_total"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
$add_house_num_total = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
$value["add_house_num_total"] = $value["add_house_num_total"] + $add_house_num_total;
}else{
$value["add_house_num_total"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
}
//todo 计算当日新增客户数 add_user_num //todo 计算当日新增客户数 add_user_num
$addUserNum = $this->userModel->getAddUserNum($where_); $addUserNum = $this->userModel->getAddUserNum($where_);
if($search_time_type == 2){ $value["add_user_num_total"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
$add_user_num_total = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
$value["add_user_num_total"] = $value["add_user_num_total"] + $add_user_num_total;
}else{
$result["add_user_num_total"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
}
} //dump($value);
array_push($arr, $value); array_push($arr, $value);
break; break;
case 3: case 3:
$value["index_"] = $key + 1; $value["index_"] = $key + 1;
$info = $this->agentModel->getAgentsInfoByAgentId($field, [ "agent_id" => $value["agent_id"] ]); $info = $this->agentModel->getAgentsInfoByAgentId($field, [ "agent_id" => $value["agent_id"] ]);
$district_name = $this->agentModel->getStoreOrDistrict([ "district_id" => $value["district_id"], "level" => [ "in", "30,40" ] ]); $district_name = $this->agentModel->getStoreOrDistrict([ "district_id" => $value["district_id"], "level" => [ "in", "30,40" ] ]);
if (count($info) > 0) { if (count($info) > 0) {
$value["name"] = count($district_name) > 0 ? $district_name[0]["name"] : "---"; $value["name"] = count($district_name) > 0 ? $district_name[0]["name"] : "---";
$value["img"] = AGENTHEADERIMGURL . $district_name[0]["img"]; $value["img"] = AGENTHEADERIMGURL . $district_name[0]["img"];
$value["store_name"] = $info[0]["store_name"]; $value["store_name"] = $info[0]["store_name"];
$value["district_name"] = $info[0]["district_name"]; $value["district_name"] = $info[0]["district_name"];
} }
//计算区域人数 //计算区域人数
$params = []; $params = [];
$params['district_id'] = $value["district_id"]; $params['district_id'] = $value["district_id"];
$params["status"] = 0; //只查询正常状态的经纪人 $params["status"] = 0; //只查询正常状态的经纪人
$value["team_num"] = $this->agentModel->getAgentsCountByStoreId($params); $value["team_num"] = $this->agentModel->getAgentsCountByStoreId($params);
//dump($search_time_type);
if($search_time_type != 1) {//如果不等于1,说明需要计算当天的数据,用不用再说
//查询总监下面门店的所有经纪人 //查询总监下面门店的所有经纪人
$params = []; $params = [];
...@@ -339,87 +230,48 @@ class PerformanceService ...@@ -339,87 +230,48 @@ class PerformanceService
$agentIds = rtrim($agentIds, ",");//经纪人ID集合 $agentIds = rtrim($agentIds, ",");//经纪人ID集合
}//查询总监下面门店的所有经纪人 end }//查询总监下面门店的所有经纪人 end
//todo 计算当日业绩 performance_total //todo 计算当日业绩 performance_total
$where_ = []; $where_ = [];
$time = date("Y-m-d", time());
//$where_["district_id"] = $district_id; //$where_["district_id"] = $district_id;
$where_["agent_id"] = array( "in", $agentIds ); $where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $time . " 04:00:00", $time . " 23:59:59" ) ); $where_['create_time'] = array( 'between', array( $end_day . " 00:00:00", $yesterday . " 23:59:59" ) );
$obargain = new OBargainModel(); $obargain = new OBargainModel();
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
if($search_time_type == 2){//如果等于2,说明需要把今天之前的数据跟今天的数据合并起来
//dump($search_time_type);
//dump('如果等于2,说明需要把今天之前的数据跟今天的数据合并起来');
$performance_total = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$value["performance_total"] = $value["performance_total"] + $performance_total;
}else{
//dump($search_time_type);
//dump('只查询今天的数据');
$value["performance_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
}
//todo 计算当日成交单数 bargain_sum //todo 计算当日成交单数 bargain_sum
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收 $performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
if($search_time_type == 2){ $value["bargain_sum_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$bargain_sum_total = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$value["bargain_sum_total"] = $value["bargain_sum_total"] + $bargain_sum_total;
}else{
$value["bargain_sum_total"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
}
//todo 计算当日收款数 paylog //todo 计算当日收款数 paylog
$receivedSum = $this->bargainModel->getAddBargainNum($where_, 2);//1表示业绩 2表示实收 $receivedSum = $this->bargainModel->getAddBargainNum($where_, 2);//1表示业绩 2表示实收
if($search_time_type == 2){ $value["paylog_total"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
$paylog_total = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
$value["paylog_total"] = $value["paylog_total"] + $paylog_total;
}else{
$value["paylog_total"] = isset($receivedSum[0]["num"]) ? $receivedSum[0]["num"] : 0;
}
//todo 计算当日进场数 march_in_num //todo 计算当日进场数 march_in_num
$addMarchInNum = $this->marchInModel->getAddMarchInNum($where_); $addMarchInNum = $this->marchInModel->getAddMarchInNum($where_);
if($search_time_type == 2){ $value["march_in_num_total"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$march_in_num_total = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
$value["march_in_num_total"] = $value["march_in_num_total"] + $march_in_num_total;
}else{
$value["march_in_num_total"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
}
//todo 计算当日报备数 look_at_num //todo 计算当日报备数 look_at_num
$reportNum = $this->reportModel->getAddReportNum($where_); $reportNum = $this->reportModel->getAddReportNum($where_);
if($search_time_type == 2){ $value["look_at_num_total"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$look_at_num_total = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$value["look_at_num_total"] = $value["look_at_num_total"] + $look_at_num_total;
}else{
$value["look_at_num_total"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
}
//todo 计算当日新增商铺数 add_house_num //todo 计算当日新增商铺数 add_house_num
$addHouseNum = $this->houseModel->getAddHouseNum($where_); $addHouseNum = $this->houseModel->getAddHouseNum($where_);
if($search_time_type == 2){ $value["add_house_num_total"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
$add_house_num_total = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
$value["add_house_num_total"] = $value["add_house_num_total"] + $add_house_num_total;
}else{
$value["add_house_num_total"] = isset($addHouseNum[0]["num"]) ? $addHouseNum[0]["num"] : 0;
}
//todo 计算当日新增客户数 add_user_num //todo 计算当日新增客户数 add_user_num
$addUserNum = $this->userModel->getAddUserNum($where_); $addUserNum = $this->userModel->getAddUserNum($where_);
if($search_time_type == 2){ $result["add_user_num_total"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
$add_user_num_total = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0; array_push($arr, $value);
$value["add_user_num_total"] = $value["add_user_num_total"] + $add_user_num_total;
}else{
$result["add_user_num_total"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
}
}
array_push($arr, $value);
break; break;
} }
} }
//dump($arr);exit;
return ['list'=>$arr,'total'=>$total]; return ['list'=>$arr,'total'=>0];
} }
......
...@@ -491,7 +491,7 @@ Route::group('broker', [ ...@@ -491,7 +491,7 @@ Route::group('broker', [
'agentPerformanceBySearch' => [ 'api_broker/Performance/agentPerformanceBySearch', [ 'method' => 'get' ] ], 'agentPerformanceBySearch' => [ 'api_broker/Performance/agentPerformanceBySearch', [ 'method' => 'get' ] ],
'orderNoList' => [ 'api_broker/Performance/orderNoList', [ 'method' => 'get' ] ], 'orderNoList' => [ 'api_broker/Performance/orderNoList', [ 'method' => 'get' ] ],
'storePerformanceBySearch' => [ 'api_broker/Performance/storePerformanceBySearch', [ 'method' => 'get' ] ], 'storePerformanceBySearch' => [ 'api_broker/Performance/storePerformanceBySearch', [ 'method' => 'get' ] ],
'storeOrAgentSort' => [ 'api_broker/Performance/storeOrAgentSort', [ 'method' => 'get' ] ], 'storeOrAgentSort' => [ 'api_broker/Performance/storeOrAgentSort', [ 'method' => 'get|post' ] ],
'weekWorkImg' => [ 'api_broker/Statement/weekWorkImg', [ 'method' => 'post' ] ], //生成周报和日报图片 'weekWorkImg' => [ 'api_broker/Statement/weekWorkImg', [ 'method' => 'post' ] ], //生成周报和日报图片
'setReportContent' => [ 'api_broker/Statement/setReportContent', [ 'method' => 'get|post' ] ], //保存日报周报四个字段 'setReportContent' => [ 'api_broker/Statement/setReportContent', [ 'method' => 'get|post' ] ], //保存日报周报四个字段
......
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