Commit 20ded7c0 authored by zhuwei's avatar zhuwei

1

parent a51ebbae
......@@ -214,12 +214,12 @@ class Statement extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
$params = array(
"agent_id" => 5739,//5739 总监 5740店长
"day_or_week" => 0,//0 日报 1 周报
);*/
);
if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) {
if (!isset($params["agent_id"]) || !isset($params["day_or_week"]) ) {
return $this->response("101", "请求参数错误");
}
......
......@@ -555,11 +555,10 @@ class StatementService
public function selectStatementForClerk($agent_id, $agent_level, $store_id,$district_id)
{
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time());
$time_ = date("Y-m-d", time());
$conditions['agent_id']=$agent_id;
$conditions['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$conditions['create_time'] = array( 'between', array( $time_ . " 00:00:00", $time_ . " 23:59:59" ) );
//todo 房源
$result["house_num"] = $this->housesToAgents->getAddHouseNumByAgentId($conditions);
......@@ -580,12 +579,11 @@ class StatementService
$conditions['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$performanceSum = $this->bargainModel->getAddBargainNum($conditions, 1);//1表示业绩 2表示实收
$result["director_performance_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$result["performance_for_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//todo 本月-成交单数
$performanceSum = $this->bargainModel->getAddBargainNumV2($conditions, 3);//1表示业绩 2表示实收
//dump($where_);exit;
$result["bargain_sum"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$result["bargain_sum_for_month"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
return $result;
}
......
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