Commit dccaaa06 authored by hujun's avatar hujun

办公楼

parent 8238b910
...@@ -263,4 +263,22 @@ class OfficeRoom extends Basic ...@@ -263,4 +263,22 @@ class OfficeRoom extends Basic
return $this->response($this->code, $this->msg, $this->data); return $this->response($this->code, $this->msg, $this->data);
} }
/**
* 楼盘列表
*
* @return \think\Response
*/
public function getBuildingRoom()
{
$result = $this->service->getRoomBuildingList($this->params);
if ($result['status'] == 'successful') {
$this->data = $result['data'];
} else {
$this->code = 101;
$this->msg = $result['msg'];
}
return $this->response($this->code, $this->msg, $this->data);
}
} }
\ No newline at end of file
...@@ -450,7 +450,7 @@ class OfficeOrderLogService ...@@ -450,7 +450,7 @@ class OfficeOrderLogService
$oBargainModel = new OfficeOBargainModel(); $oBargainModel = new OfficeOBargainModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]); $orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,c.address as internal_address", ["order_id" => $order_id]);
//dump($orderData); //dump($orderData);
if (count($orderData) <= 0) { if (count($orderData) <= 0) {
return ["101", "找不到此订单编号"]; return ["101", "找不到此订单编号"];
...@@ -566,7 +566,7 @@ class OfficeOrderLogService ...@@ -566,7 +566,7 @@ class OfficeOrderLogService
$oRefundLogModel = new OfficeORefundLoORefundLogModel(); $oRefundLogModel = new OfficeORefundLoORefundLogModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]); $orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,c.address as internal_address", ["order_id" => $order_id]);
//dump($orderData); //dump($orderData);
if (count($orderData) <= 0) { if (count($orderData) <= 0) {
return ["101", "找不到此订单编号"]; return ["101", "找不到此订单编号"];
......
...@@ -1126,4 +1126,140 @@ class OfficeRoomService ...@@ -1126,4 +1126,140 @@ class OfficeRoomService
} }
return $res; return $res;
} }
/**
* 办公楼列表
*
* @param $params
* @return array
*/
public function getRoomBuildingList($params)
{
$page_no = empty($params['pageNo']) ? 1 : $params['pageNo'];
$page_size = empty($params['pageSize']) ? 15 : $params['pageSize'];
$where = [];
$order = 'b.id desc';
if (isset($params['city'])) {
$where['a.city'] = $params['city']; //市
}
if (isset($params['disc'])) {
$where['a.disc'] = $params['disc']; //区
}
if (isset($params['title'])) {
$where['a.title'] = ['LIKE', '%'.$params['title'].'%']; //楼盘名
}
if (isset($params['id'])) {
$where['a.id'] = $params['id'];
}
if (isset($params['`business_district_id`'])) {
$where['a.business_district_id'] = $params['business_district_id']; //商圈id
}
if (isset($params['area_start'])) {
$where['b.area'] = ['>', $params['area_start']]; //面积
}
if (isset($params['area_end'])) {
$where['b.area'] = ['<', $params['area_end']]; //面积
}
if (isset($params['area_start']) && $params['area_end']) {
$where['b.area'] = ['between', [$params['area_start'], $params['area_end']]]; //面积
}
if (isset($params['type'])) {
$where['a.type'] = $params['type']; //1.写字楼 2商住两用 3园区 4.洋房 5联合办公 6厂房
}
if (isset($params['price_start'])) {
$where['b.price'] = $params['price_start']*100;//租金单价
}
if (isset($params['price_end'])) {
$where['b.price'] = $params['price_end']*100;//租金单价
}
if (isset($params['price_start']) && isset($params['price_end'])) {
$where['b.price'] = ['between', [$params['price_start']*100, $params['price_end']*100]]; //租金单价
}
if (isset($params['is_exclusive_type'])) {
$where['b.is_exclusive_type'] = $params['is_exclusive_type']; //是否独家0否1是
}
if (isset($params['agent_start_time']) && $params['agent_end_time']) {
$where['b.agent_start_time'] = ['>', $params['agent_start_time']]; //独家合同开始时间
$where['b.agent_end_time'] = ['<', $params['agent_end_time']]; //独家合同结束时间
}
if (isset($params['is_rent'])) {
$where['b.is_rent'] = $params['is_rent']; //是否已租 0未租 1已租
}
if (isset($params['status'])) {
$where['a.status'] = $params['status']; //状态 1上架 2下架
}
if (isset($params['shop_sign'])) {
$where['b.shop_sign'] = ['like', '%'.$params['shop_sign'].'%']; //商铺标签
}
if (isset($params['is_carefully_chosen'])) {
$where['b.is_carefully_chosen'] = $params['shop_sign']; //精选商铺--0否1是
$order = 'b.home_page_sort desc';
}
$field = 'a.id,b.disc,title,address,c.name as business_name';
try {
$data = $this->m_office_room->getRoomBuilding($page_no, $page_size, $order, $field, $where);
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
return $result;
}
$result_data = [];
foreach ($data as $k=>$v) {
$tmp['id'] = $v['id'];
$tmp['price'] = $this->MinField($v['id'], 'price');
$tmp['price'] = empty($tmp['price']) ? 0:$tmp['price'];
$tmp['price_total'] = $this->MinField($v['id'], 'price_total');
$tmp['price_total'] = empty($tmp['price_total']) ? 0:$tmp['price_total'];
$tmp['shop_sign'] = $this->getBuildingSign($v['id']);
$area = $this->MinField($v['id'], 'area');
$tmp['title'] = $v['disc'].' '.$v['business_name']. ' '.$v['title']. ' '.$area.'㎡';
$result_data[] = $tmp;
}
$result['status'] = 'successful';
$result['data'] = $result_data;
return $result;
}
/**
* 标签处理
*
* @param $id
* @return string
*/
private function getBuildingSign($id){
$field = 'shop_sign';
$where['building_id'] = $id;
$where['status'] = 1;
$res = $this->m_office_room->getRoom($field, $where);
if(!$res)
return '';
$shop_sign_old = '';
foreach ($res as $k=>$v) {
$shop_sign_old.=','.$v['shop_sign'];
}
$ex_shop_sign_old = explode(',', trim($shop_sign_old, ","));
$ex_shop_sign_old = array_unique($ex_shop_sign_old);//数组去重
$shop_sign = implode(",", $ex_shop_sign_old);
return $shop_sign;
}
} }
\ No newline at end of file
...@@ -393,4 +393,28 @@ class OfficeGRoom extends BaseModel ...@@ -393,4 +393,28 @@ class OfficeGRoom extends BaseModel
//echo Db::table($this->table)->getLastSql(); //echo Db::table($this->table)->getLastSql();
return $result; return $result;
} }
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getRoomBuilding($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '') {
$params['b.is_del'] = 0;
return $this->field($field)
->alias('a')
->join('office_g_building b', 'a.building_id = b.id', 'left')
->join('g_business_district c', 'b.business_district_id = c.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
} }
...@@ -118,9 +118,9 @@ class OfficeOPayLogAdjustment extends BaseModel{ ...@@ -118,9 +118,9 @@ class OfficeOPayLogAdjustment extends BaseModel{
public function getAdjustmentListLimit($pageNo, $pageSize, $order_='a.id desc', $field, $params){ public function getAdjustmentListLimit($pageNo, $pageSize, $order_='a.id desc', $field, $params){
return $this->db_->field($field) return $this->db_->field($field)
->alias("a") ->alias("a")
->join("o_paylog b", "a.paylog_id = b.id", "left") ->join("office_o_paylog b", "a.paylog_id = b.id", "left")
->join("a_agents d", "a.operation_id = d.id", "left") ->join("a_agents d", "a.operation_id = d.id", "left")
->join("o_order e", "b.order_id = e.id") ->join("office_o_order e", "b.order_id = e.id")
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->order($order_) ->order($order_)
...@@ -134,9 +134,9 @@ class OfficeOPayLogAdjustment extends BaseModel{ ...@@ -134,9 +134,9 @@ class OfficeOPayLogAdjustment extends BaseModel{
*/ */
public function getAdjustmentListTotal($params) { public function getAdjustmentListTotal($params) {
return $this->db_->alias('a') return $this->db_->alias('a')
->join("o_paylog b", "a.paylog_id = b.id", "left") ->join("office_o_paylog b", "a.paylog_id = b.id", "left")
->join("a_agents d", "a.operation_id = d.id", "left") ->join("a_agents d", "a.operation_id = d.id", "left")
->join("o_order e", "b.order_id = e.id") ->join("office_o_order e", "b.order_id = e.id")
->where($params) ->where($params)
->count('a.id'); ->count('a.id');
} }
...@@ -149,9 +149,9 @@ class OfficeOPayLogAdjustment extends BaseModel{ ...@@ -149,9 +149,9 @@ class OfficeOPayLogAdjustment extends BaseModel{
*/ */
public function getMoneyTotal($params) { public function getMoneyTotal($params) {
return $this->db_->alias('a') return $this->db_->alias('a')
->join("o_paylog b", "a.paylog_id = b.id", "left") ->join("office_o_paylog b", "a.paylog_id = b.id", "left")
->join("a_agents d", "a.operation_id = d.id", "left") ->join("a_agents d", "a.operation_id = d.id", "left")
->join("o_order e", "b.order_id = e.id") ->join("office_o_order e", "b.order_id = e.id")
->where($params) ->where($params)
->sum('a.money'); ->sum('a.money');
} }
......
...@@ -975,7 +975,7 @@ Route::group('office', [ ...@@ -975,7 +975,7 @@ Route::group('office', [
'filtrateConditionRoom' => ['api/shop/filtrateConditionRoom', ['method' => 'get | post']], 'filtrateConditionRoom' => ['api/shop/filtrateConditionRoom', ['method' => 'get | post']],
'addCollectHouse' => ['api_broker/OfficeCollectHouse/addCollectHouse', ['method' => 'POST|GET']], //收藏或取消收藏商铺 'addCollectHouse' => ['api_broker/OfficeCollectHouse/addCollectHouse', ['method' => 'POST|GET']], //收藏或取消收藏商铺
'getCollectHouseList' => ['api_broker/OfficeCollectHouse/getCollectHouseList', ['method' => 'POST|GET']], //查询收藏数据 'getCollectHouseList' => ['api_broker/OfficeCollectHouse/getCollectHouseList', ['method' => 'POST|GET']], //查询收藏数据
'getBuildingRoom' => ['api_broker/OfficeBuilding/getBuildingRoom', ['method' => 'POST|GET']], //楼盘列表 'getBuildingRoom' => ['api_broker/OfficeRoom/getBuildingRoom', ['method' => 'POST|GET']], //楼盘列表
'report' => ['api_broker/OfficeReport/report', ['method' => 'get|post']], //报备 'report' => ['api_broker/OfficeReport/report', ['method' => 'get|post']], //报备
'addFollowUp' => ['api_broker/OfficeReport/addFollowUp', ['method' => 'get|post']], //新增跟进 'addFollowUp' => ['api_broker/OfficeReport/addFollowUp', ['method' => 'get|post']], //新增跟进
'getFollowUpList' => ['api_broker/OfficeReport/getFollowUpList', ['method' => 'get|post']], 'getFollowUpList' => ['api_broker/OfficeReport/getFollowUpList', ['method' => 'get|post']],
...@@ -1005,6 +1005,9 @@ Route::group('office_index', [ ...@@ -1005,6 +1005,9 @@ Route::group('office_index', [
'batchChangDish' => ['index/OfficeRoom/batchChangDish', ['method' => 'post']],//批量修改盘方 'batchChangDish' => ['index/OfficeRoom/batchChangDish', ['method' => 'post']],//批量修改盘方
'getCollection' => ['index/OfficePayLog/getCollection', ['method' => 'GET']],//收款记录 'getCollection' => ['index/OfficePayLog/getCollection', ['method' => 'GET']],//收款记录
'getCollectionExcel' => ['index/OfficePayLog/getCollectionExcel', ['method' => 'get']],//导出收款记录 'getCollectionExcel' => ['index/OfficePayLog/getCollectionExcel', ['method' => 'get']],//导出收款记录
'adjustment' => ['index/OfficePayLog/adjustment', ['method' => 'get']],//导出收款记录
'getCollectionDetail' => ['index/OfficePayLog/getCollectionDetail', ['method' => 'get']],//收款详情
'getAdjustmentDetail' => ['index/OfficePayLog/getAdjustmentDetail', ['method' => 'get']],//调整收款详情
]); ]);
......
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