Commit 0aeb2f4c authored by zhuwei's avatar zhuwei

业绩

parent cb508e89
...@@ -619,7 +619,7 @@ class StatementService ...@@ -619,7 +619,7 @@ class StatementService
} }
/** /**
* 店长日报 6666666 * 店长日报 2019年06月17日 线上
* @param $agent_id * @param $agent_id
* @param $agent_level * @param $agent_level
* @param $store_id * @param $store_id
...@@ -800,7 +800,7 @@ class StatementService ...@@ -800,7 +800,7 @@ class StatementService
/** /**
* 查询总监日报数据 * 总监日报 2019年06月28日 线上
* @param $agent_id * @param $agent_id
* @param $agent_level * @param $agent_level
* @param $store_id * @param $store_id
...@@ -814,19 +814,22 @@ class StatementService ...@@ -814,19 +814,22 @@ class StatementService
$agent_res = $this->getAgentIDsByDistrictId($district_id,$agent_level); $agent_res = $this->getAgentIDsByDistrictId($district_id,$agent_level);
$conditions['agent_id'] = array( "in", $agent_res['agent_ids'] ); $conditions['agent_id'] = array( "in", $agent_res['agent_ids'] );
// 本月-业绩 ############################## 本月数据 ################################################
$start_time = date("Y-m-01", time()); $start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time()); $end_time = date("Y-m-d", time());
$conditions['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); $conditions['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// 业绩
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 1);//1表示业绩 2表示实收 $performanceSum = $this->bargainModel->getAddBargainNumV3($conditions, 1);//1表示业绩 2表示实收
$result["performance_for_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0; $result["district_month_performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 实收
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 2);//1表示业绩 2表示实收
$result["district_month_real_performance"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 本月-成交单数 // 本月-成交单数
$performanceSum = $this->bargainModel->getAddBargainNumV2($conditions, 3);//1表示业绩 2表示实收 $performanceSum = $this->bargainModel->getAddBargainNumV2($conditions, 3);//1表示业绩 2表示实收
$result["bargain_sum_for_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0; $result["district_month_bargain_sum"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//人数 //人数
$agent_res = $this->getAgentIDsByDistrictId($district_id,$agent_level,1);
$result["district_team_num"] = $agent_res['store_list_num']; $result["district_team_num"] = $agent_res['store_list_num'];
return $result; return $result;
} }
......
...@@ -839,7 +839,7 @@ class OBargainModel extends Model ...@@ -839,7 +839,7 @@ class OBargainModel extends Model
$field = "sum(practical_fee) as num"; $field = "sum(practical_fee) as num";
} elseif ($type == 3) { } elseif ($type == 3) {
$field = "count(1) as num"; $field = "count(1) as num";
$where_["a.role"] = 3;//必须是反签方 $where_["a.role"] = 3;//必须是反签方1
$where_["a.status"] = array( "in", '10,11,13'); $where_["a.status"] = array( "in", '10,11,13');
} }
......
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