Commit c739183f authored by hujun's avatar hujun

楼盘字典列表

parent 2fe62253
......@@ -118,12 +118,14 @@ class OfficeManage extends Basic
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$building_service = new OfficeService();
$result = $building_service->BuildingSearch($pageNo, $pageSize, $this->params1, 1);
$result = $building_service->BuildingSearch($pageNo, $pageSize, $this->params, 1);
if ($result['status'] == 'fail') {
$code = 101;
$msg = $result['msg'];
} else {
$data = $result['data'];
$data['list'] = $result['data'];
$data['total'] = $result['total'];
}
return $this->response($code, $msg, $data);
......
......@@ -9,7 +9,9 @@
namespace app\index\service;
use app\index\controller\BusinessDistrict;
use app\index\validate\OfficeBuildingValidate;
use app\model\GBusinessDistrict;
use app\model\OfficeGBuilding;
use app\model\OfficeGImg;
use app\model\OfficeGBuildingStations;
......@@ -224,10 +226,6 @@ class OfficeService
{
$result['status'] = 'fail';
$result['msg'] = '';
if (empty($params['title'])) {
$result['msg'] = '参数错误';
return $result;
}
if (empty($params['city'])) {
$result['msg'] = '参数错误';
......@@ -250,12 +248,24 @@ class OfficeService
$where['type'] = $params['type'];
}
$field = 'id,title,address,type';
if (isset($params['id'])) {
$where['id'] = $params['id'];
}
$field = 'id,title,address,type,floor_total,business_district_id,intro';
$where['city'] = $params['city'];
$data = $this->m_office->getList($page_size, $page_no, '', $field, $where);
if ($is_total) {
$data = $this->m_office->getTotal($where);
$result['total'] = $this->m_office->getTotal($where);
$m_business = new GBusinessDistrict();
foreach ($data as $k=>$v) {
if (isset($v['business_district_id'])) {
$data[$k]['business_name'] = $m_business->getFieldOneValue('name', ['id'=>$v['business_district_id']]);
}
}
}
$result['data'] = $data;
$result['status'] = 'successful';
......
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