Commit e9784a55 authored by zw's avatar zw Committed by hujun

带看

parent 9235b69e
...@@ -82,7 +82,7 @@ class Report extends Basic ...@@ -82,7 +82,7 @@ class Report extends Basic
* @return \think\Response * @return \think\Response
*/ */
public function reportList(){ public function reportList(){
/* $params = array( /* $params = array(
"agent_id" =>1, "agent_id" =>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告 "type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1, "page_no"=>1,
...@@ -90,14 +90,14 @@ class Report extends Basic ...@@ -90,14 +90,14 @@ class Report extends Basic
);*/ );*/
$params = $this->params; $params = $this->params;
if(!isset($params["agent_id"])){ if(!isset($params["agent_id"]) || !isset($params["type"])){
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$pageNo = empty($params['page_no']) ? 1 : $params['page_no']; $pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size']; $pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.id as order_id,b.house_id,b.house_title"; $field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderList($field,$params,$pageNo,$pageSize); $result = $this->service_->orderList($field,$params,$pageNo,$pageSize);
......
...@@ -89,13 +89,52 @@ class OReportModel extends Model ...@@ -89,13 +89,52 @@ class OReportModel extends Model
$where_["a.status"] = 0; $where_["a.status"] = 0;
$where_["b.is_del"] = 0; $where_["b.is_del"] = 0;
return $this->db switch ($params["type"]){
->field($filed) case 2:
->alias("a") return $this->db
->join("o_order b","a.id= b.f_id","left") ->field($filed)
->where($where_) ->alias("a")
->limit($pageSize) ->join("o_order b","a.id= b.f_id","left")
->page($pageNo) ->join("o_march_in c","b.id= c.order_id","right")
->select(); ->where($where_)
->group("c.order_id ")
->limit($pageSize)
->page($pageNo)
->select();
case 3:
return $this->db
->field($filed)
->alias("a")
->join("o_order b","a.id= b.f_id","left")
->join("o_paylog c","b.id= c.order_id","right")
->where($where_)
->group("c.order_id ")
->limit($pageSize)
->page($pageNo)
->select();
case 4:
return $this->db
->field($filed)
->alias("a")
->join("o_order b","a.id= b.f_id","left")
->join("o_bargain c","b.id= c.order_id","right")
->where($where_)
->group("c.order_id ")
->limit($pageSize)
->page($pageNo)
->select();
default:
return $this->db
->field($filed)
->alias("a")
->join("o_order b","a.id= b.f_id","left")
->where($where_)
->limit($pageSize)
->page($pageNo)
->select();
}
} }
} }
\ No newline at end of file
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