Commit fbdcc47a authored by zw's avatar zw

带看列表显示商铺地址

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