Commit b55785a3 authored by zhuwei's avatar zhuwei

bug

parent d5a7b406
......@@ -38,17 +38,8 @@ class Statement extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
Log::write($params, 'zhuwei'); //记录日志
/*$params = array(
"agent_id" => 3742,//5739 总监 5740店长
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()),
);*/
/*$params = array (
'agent_id' => '5739',
'time_start' => '2018-11-23',
'time_end' => '2018-11-23',
);*/
// big_log('日报周报获取新增数据-dayStatement');
// big_log(json_encode($params));
if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) {
return $this->response("101", "请求参数错误");
......
......@@ -265,7 +265,8 @@ class StatementService
//$where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"];
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// $obargain = new OBargainModel();
$where_['status'] =array( "in", '10, 11, 13' );
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["director_performance_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......@@ -286,11 +287,9 @@ class StatementService
$where_ = [];
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time());
// $where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"];
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// $obargain = new OBargainModel();
$where_['status'] =array( "in", '10, 11, 13' );
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["director_performance_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......@@ -298,10 +297,9 @@ class StatementService
$where_ = [];
$start_time = date("Y-m-d", strtotime("-13 day"));
$end_time = date("Y-m-d", strtotime("-7 day"));
// $where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"];
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// $obargain = new OBargainModel();
$where_['status'] =array( "in", '10, 11, 13' );
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["director_last_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......@@ -310,10 +308,9 @@ class StatementService
$where_ = [];
$start_time = date("Y-m-d", strtotime("-7 day"));
$end_time = date("Y-m-d", time());
// $where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"];
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// $obargain = new OBargainModel();
$where_['status'] =array( "in", '10, 11, 13' );
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$result["director_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......@@ -488,6 +485,7 @@ class StatementService
$end_time = date("Y-m-d", time());
$where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$where_['status'] =array( "in", '10, 11, 13' );
$obargain = new OBargainModel();
//dump($where_);
......@@ -507,6 +505,8 @@ class StatementService
$end_time = date("Y-m-d", time());
$where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$where_['status'] =array( "in", '10, 11, 13' );
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$results[$key]["director_week_performance_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 本月业绩
......
......@@ -780,13 +780,14 @@ class OBargainModel extends Model
$where_["a.status"] = $params["status"];
}
$return = Db::table($this->table)
->field($field)
->alias("a")
->join($join)
->where($where_)
->select();
big_log($this->getLastSql());
// big_log($this->getLastSql());
return $return;
}
public function getAddBargainNumV2($params, $type)
......
......@@ -399,7 +399,7 @@ class OPayLogModel extends Model
->sum($field);
}
big_log($this->getLastSql());
// big_log($this->getLastSql());
return $data;
}
......
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