Commit b55785a3 authored by zhuwei's avatar zhuwei

bug

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