Commit a935f411 authored by zw's avatar zw

业绩订单列表

parent 6c4f82c6
...@@ -84,7 +84,7 @@ class Performance extends Basic ...@@ -84,7 +84,7 @@ class Performance extends Basic
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} }
public function orderNoLIst(){ public function orderNoList(){
$params = $this->params; $params = $this->params;
$params = array( $params = array(
"agent_id" => 1, "agent_id" => 1,
...@@ -92,7 +92,7 @@ class Performance extends Basic ...@@ -92,7 +92,7 @@ class Performance extends Basic
"end_time" => "2018-03-23", "end_time" => "2018-03-23",
"is_case" => 2,//1经纪人 2案场 "is_case" => 2,//1经纪人 2案场
"house_id" => 0, "house_id" => 0,
"type" => 1 // 1带看 2进场 3收款 4成交报告 "type" => 2 // 1带看 2进场 3收款 4成交报告
); );
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"]) || !isset($params["type"]) ) { if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"]) || !isset($params["type"]) ) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
......
...@@ -200,25 +200,26 @@ class PerformanceService ...@@ -200,25 +200,26 @@ class PerformanceService
} }
/**
* @param $agent_id
* @param $start_time
* @param $end_time
* @param $is_case
* @param $house_id
* @param $type
* @return null
*/
public function orderList($agent_id, $start_time, $end_time, $is_case, $house_id, $type) public function orderList($agent_id, $start_time, $end_time, $is_case, $house_id, $type)
{ {
$params = [];
$result = [];
switch ($is_case) { switch ($is_case) {
case 1: case 1:
$params["agent_id"] = $agent_id; $params["agent_id"] = $agent_id;
$params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); $params['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$result = $this->nowTimeSum($params);
break; break;
case case 2: //案场
2: //案场
$house_id_arr = [];
if ($house_id > 0) { // 如果有传楼盘id证明是筛选 if ($house_id > 0) { // 如果有传楼盘id证明是筛选
$condition["house_ids"] = $house_id; $params["house_ids"] = $house_id;
} else { } else {
$vService = new VerifyService(); $vService = new VerifyService();
$house_id_arr = $vService->getCaseHouseIdByAgentId($agent_id); $house_id_arr = $vService->getCaseHouseIdByAgentId($agent_id);
...@@ -227,17 +228,13 @@ class PerformanceService ...@@ -227,17 +228,13 @@ class PerformanceService
$ids .= $item["houses_id"] . ","; $ids .= $item["houses_id"] . ",";
} }
$ids = rtrim($ids, ","); $ids = rtrim($ids, ",");
$condition["house_ids"] = $ids; $params["house_ids"] = $ids;
} }
$condition['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) ); $condition['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$result = $this->nowTimeSum($condition);
if (count($result) > 0 && $house_id == 0) {
$result["house_arr"] = $house_id_arr;
}
break; break;
} }
$result = $this->getOrderList($params,$type);
if (count($result) > 0) { if (count($result) > 0) {
return $result; return $result;
} else { } else {
...@@ -246,6 +243,35 @@ class PerformanceService ...@@ -246,6 +243,35 @@ class PerformanceService
} }
private function getOrderList($params, $type)
{
$result = [];
//1带看 2进场 3收款 4成交报告
switch ($type) {
case 1:
$field = "DATE(a.create_time) as create_time,a.user_phone,a.user_name,a.user_id,b.house_id,b.house_title";
$result = $this->reportModel->getAddReportOrderList($field, $params);
break;
case 2:
$field = "DATE(a.create_time) as create_time ,b.house_id,b.house_title,c.user_phone,c.user_name,c.user_id";
$result = $this->marchInModel->getAddMarchInOrderList($field,$params);
break;
case 3:
$field = "DATE(a.create_time) as create_time ,b.house_id,b.house_title,c.user_phone,c.user_name,c.user_id";
$result = $this->payLogModel->getAddPayLogOrderList($field,$params);
break;
case 4:
$field = "DATE(a.create_time) as create_time ,b.house_id,b.house_title,c.user_phone,c.user_name,c.user_id";
$result = $this->bargainModel->getAddBargainOrderList($field,$params);
break;
default:
}
return $result;
}
/** /**
* @param $params * @param $params
* @return array * @return array
......
...@@ -346,4 +346,27 @@ class OBargainModel extends Model ...@@ -346,4 +346,27 @@ class OBargainModel extends Model
->where($where_) ->where($where_)
->select(); ->select();
} }
public function getAddBargainOrderList($field,$params){
$where_ = [];
if(isset($params["agent_id"])){
$where_["a.agent_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["a.create_time"] = $params["create_time"];
}
if(isset($params["house_ids"])){
$where_["b.house_id"] = array("in",$params["house_ids"]);
}
return Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b","a.order_id = b.id","left")
->join("o_report c","b.f_id = c.id","left")
->where($where_)
->select();
}
} }
\ No newline at end of file
...@@ -116,4 +116,24 @@ class OMarchInModel extends Model ...@@ -116,4 +116,24 @@ class OMarchInModel extends Model
->select(); ->select();
} }
public function getAddMarchInOrderList($field,$params){
$where_ = [];
if(isset($params["agent_id"])){
$where_["a.reception_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["a.create_time"] = $params["create_time"];
}
if(isset($params["house_ids"])){
$where_["b.house_id"] = array("in",$params["house_ids"]);
}
return Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b","a.order_id = b.id","left")
->join("o_report c","b.f_id = c.id","left")
->where($where_)
->select();
}
} }
\ No newline at end of file
...@@ -113,4 +113,24 @@ class OPayLogModel extends Model ...@@ -113,4 +113,24 @@ class OPayLogModel extends Model
->where($where_) ->where($where_)
->select(); ->select();
} }
public function getAddPayLogOrderList($field,$params){
$where_ = [];
if(isset($params["agent_id"])){
$where_["a.agent_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["a.create_time"] = $params["create_time"];
}
if(isset($params["house_ids"])){
$where_["b.house_id"] = array("in",$params["house_ids"]);
}
return Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b","a.order_id = b.id","left")
->join("o_report c","b.f_id = c.id","left")
->where($where_)
->select();
}
} }
\ No newline at end of file
...@@ -176,5 +176,24 @@ class OReportModel extends Model ...@@ -176,5 +176,24 @@ class OReportModel extends Model
//echo Db::table($this->table)->getLastSql(); //echo Db::table($this->table)->getLastSql();
return $result; return $result;
} }
public function getAddReportOrderList($field,$params){
$where_ = [];
if(isset($params["agent_id"])){
$where_["a.report_agent_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["a.create_time"] = $params["create_time"];
}
if(isset($params["house_ids"])){
$where_["b.house_id"] = array("in",$params["house_ids"]);
}
$where_["a.status"] = 0;
return Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b","a.id = b.f_id","left")
->where($where_)
->select();
}
} }
\ No newline at end of file
...@@ -362,6 +362,7 @@ Route::group('broker', [ ...@@ -362,6 +362,7 @@ Route::group('broker', [
'selectPerformanceByTime' => ['api_broker/Performance/selectPerformanceByTime', ['method' => 'get']], 'selectPerformanceByTime' => ['api_broker/Performance/selectPerformanceByTime', ['method' => 'get']],
'agentPerformanceBySearch' => ['api_broker/Performance/agentPerformanceBySearch', ['method' => 'get']], 'agentPerformanceBySearch' => ['api_broker/Performance/agentPerformanceBySearch', ['method' => 'get']],
'orderNoList' => ['api_broker/Performance/orderNoList', ['method' => 'get']],
'weekWorkImg' => ['api_broker/Statement/weekWorkImg', ['method' => 'post']], //生成周报和日报图片 'weekWorkImg' => ['api_broker/Statement/weekWorkImg', ['method' => 'post']], //生成周报和日报图片
'setReportContent' => ['api_broker/Statement/setReportContent', ['method' => 'get|post']], //保存日报周报四个字段 'setReportContent' => ['api_broker/Statement/setReportContent', ['method' => 'get|post']], //保存日报周报四个字段
......
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