Commit fbdcc47a authored by zw's avatar zw

带看列表显示商铺地址

parent 660b994a
...@@ -1148,10 +1148,13 @@ class OrderLogService ...@@ -1148,10 +1148,13 @@ class OrderLogService
} }
/** /**
* @param $params 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址 * @param $params1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
* @return mixed * @param $pageNo
* @throws \think\db\exception\BindParamException * @param $pageSize
* @throws \think\exception\PDOException * @return array|mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getSearchOrderByAll($params, $pageNo, $pageSize) public function getSearchOrderByAll($params, $pageNo, $pageSize)
{ {
...@@ -1191,29 +1194,9 @@ class OrderLogService ...@@ -1191,29 +1194,9 @@ class OrderLogService
$orderModel = new OrderModel(); $orderModel = new OrderModel();
$result = $orderModel->searchOrderAll($field, $condition, $where_, $pageNo, $pageSize); $result = $orderModel->searchOrderAll($field, $condition, $where_, $pageNo, $pageSize);
$ids_str = "";
if (count($result) <= 0) {
return null;
} else {
foreach ($result as $k => $v) {
$ids_str .= $v["id"] . ",";
}
$ids_str = rtrim($ids_str, ",");
$reportService = new ReportService(); $reportService = new ReportService();
return $reportService->returnResult($result);
$sign_arr = $reportService->orderSign($ids_str);
foreach ($result as $k => $v) {
foreach ($sign_arr as $value) {
if ($v["id"] == $value["order_id"]) {
$result[$k]["sign"] .= $reportService->signTitle($value["type"]) . ",";
}
}
}
return $result;
}
} }
/** /**
......
...@@ -127,6 +127,18 @@ class ReportService ...@@ -127,6 +127,18 @@ class ReportService
$params["house_ids"] = $ids; $params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize); $result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
return $this->returnResult($result);
}
/**
* @param $result
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function returnResult($result){
$ids_str = ""; $ids_str = "";
$house_id_str = ""; $house_id_str = "";
if (count($result) > 0) { if (count($result) > 0) {
...@@ -157,11 +169,9 @@ class ReportService ...@@ -157,11 +169,9 @@ class ReportService
} }
} }
return $result;
} }
return null; return $result;
} }
/** /**
* 报备订单列表All * 报备订单列表All
* @param $field * @param $field
...@@ -176,38 +186,7 @@ class ReportService ...@@ -176,38 +186,7 @@ class ReportService
{ {
$params = []; $params = [];
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize); $result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
return $this->returnResult($result);
$ids_str = "";
$house_id_str = "";
if (count($result) > 0) {
foreach ($result as $k => $v) {
$ids_str .= $v["order_id"] . ",";
$house_id_str .= $v["house_id"] . ",";
}
$ids_str = rtrim($ids_str, ",");
$house_id_str = rtrim($house_id_str, ",");
$sign_arr = $this->orderSign($ids_str);
$house_arr = $this->houseInfo($house_id_str);
foreach ($result as $k => $v) {
$result[$k]["sign"] = "";
foreach ($sign_arr as $value) {
if ($v["order_id"] == $value["order_id"]) {
$result[$k]["sign"] .= $this->signTitle($value["type"]) . ",";
}
foreach ($house_arr as $item) {
if ($v["house_id"] == $item["id"]) {
$result[$k]["house_address"] .= $item["internal_title"];
}
}
}
}
return $result;
}
return null;
} }
/** /**
...@@ -244,27 +223,9 @@ class ReportService ...@@ -244,27 +223,9 @@ class ReportService
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize); $result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$count = $this->oReportModel->selectReportCount($field,$params); $count = $this->oReportModel->selectReportCount($field,$params);
$ids_str = "";
if (count($result) > 0) {
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 = rtrim($ids_str, ",");
$sign_arr = $this->orderSign($ids_str); if (count($result) > 0) {
$data["result"] = $this->returnResult($result);
foreach ($result as $k => $v) {
$result[$k]["sign"] = "";
foreach ($sign_arr as $value) {
if ($v["order_id"] == $value["order_id"]) {
$result[$k]["sign"] .= $this->signTitle($value["type"]) . ",";
}
}
}
$data["result"] = $result;
$data["total"] = $count[0]["total"] ? $count[0]["total"] : 0; $data["total"] = $count[0]["total"] ? $count[0]["total"] : 0;
return $data; return $data;
} }
...@@ -277,6 +238,13 @@ class ReportService ...@@ -277,6 +238,13 @@ class ReportService
return $this->orderModel->selectSign($ids_str); return $this->orderModel->selectSign($ids_str);
} }
/**
* @param $house_id_str
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function houseInfo($house_id_str) public function houseInfo($house_id_str)
{ {
$houseModel = new GHouses(); $houseModel = new GHouses();
......
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