Commit 0e5cb1a3 authored by zw's avatar zw Committed by hujun

带看

parent 4b3e7596
......@@ -82,13 +82,13 @@ class Report extends Basic
* @return \think\Response
*/
public function reportList(){
$params = array(
/* $params = array(
"agent_id" =>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);
//$params = $this->params;
);*/
$params = $this->params;
if(!isset($params["agent_id"])){
return $this->response("101", "请求参数错误");
......@@ -97,7 +97,7 @@ class Report extends Basic
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$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.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.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderList($field,$params,$pageNo,$pageSize);
......
......@@ -91,11 +91,22 @@ class ReportService
foreach ($result as $k=>$v){
$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$ids_str += $v["order_id"] + ",";
$ids_str .= $v["order_id"] .",";
}
$ids_str = rtrim($ids_str, ",");
$sign_arr = $this->orderSign($ids_str);
dump($sign_arr);
foreach ($result as $k=>$v){
foreach ($sign_arr as $value){
if($v["order_id"] == $value["order_id"]){
$result[$k]["sign"] .= $this->signTitle($value["type"]).",";
}
}
}
return $result;
}
return null;
......@@ -106,6 +117,19 @@ class ReportService
return $this->orderModel->selectSign($ids_str);
}
private function signTitle($type){
switch ($type){
case 2:
return "进场";
case 3:
return "收款";
case 4:
return "成交报告";
default:
return null;
}
}
/**
* 订单号
......
......@@ -61,7 +61,7 @@ class OrderModel extends Model
public function selectSign($ids){
return $this->db_
->field('id as order_id,1 as type')
->where(["id",["in",$ids]])
->where("id","in",0)
->union('SELECT order_id,2 as type FROM o_march_in where order_id in ('.$ids.') group by order_id')
->union('SELECT order_id,3 as type FROM o_paylog where order_id in ('.$ids.') group by order_id')
->union('SELECT order_id,4 as type FROM o_bargain where order_id in ('.$ids.') group by order_id')
......
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