Commit 38b051ec authored by zhuwei's avatar zhuwei

bug

parent 2ef8ce10
......@@ -137,8 +137,12 @@ class StatementService
//本月业绩
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", strtotime("-1 day"));;
$end_time = date("Y-m-d", strtotime("-1 day"));
if($user_type == 2){//如果是总监
$where_["agent_id"] = array( "in", $agentIds );
}else{
$where_["district_id"] = $district_id;
}
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
......@@ -156,9 +160,12 @@ class StatementService
//本月完成单数
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", strtotime("-1 day"));
if($user_type == 2){//如果是总监
$where_["agent_id"] = array( "in", $agentIds );
}else{
$where_["district_id"] = $district_id;
}
$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;
......@@ -215,7 +222,7 @@ class StatementService
//todo 本月业绩
$where_ = [];
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", strtotime("-1 day"));;
$end_time = date("Y-m-d", strtotime("-1 day"));
$where_["district_id"] = $district_id;
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$obargain = new OBargainModel();
......@@ -367,7 +374,6 @@ class StatementService
$end_time = date("Y-m-d", strtotime("-7 day"));
$where_["store_id"] = $value["store_id"];
$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表示实收
$results[$key]["director_last_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//todo 本周周业绩
......@@ -376,7 +382,6 @@ class StatementService
$end_time = date("Y-m-d", time());
$where_["store_id"] = $value["store_id"];
$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表示实收
$results[$key]["director_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 本月业绩
......
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