Commit 8238b910 authored by zhuwei's avatar zhuwei

我的办公楼

parent 399e3aa1
......@@ -97,9 +97,8 @@ class OfficeRoom extends Basic
return $this->response("101", $checkResult);
}
$broker_service = new OfficeRoomService();
$id = $params['id'];
$result = $broker_service->getOfficeRoomInfo($id,$this->agentId);
$result = $this->service->getOfficeRoomInfo($id,$this->agentId);
return $this->response($result['status'],$result['msg'], $result['data']);
}
......@@ -250,4 +249,18 @@ class OfficeRoom extends Basic
}
/**
* 我的办公楼-房源
* @return \think\Response
*/
public function getMyBuildingRoom()
{
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$result = $this->service->getMyBuildingRoom($pageNo, $pageSize, $this->agentId);
return $this->response($this->code, $this->msg, $this->data);
}
}
\ No newline at end of file
......@@ -1100,4 +1100,30 @@ class OfficeRoomService
}
return $result;
}
/**
* 我的办公楼
* @param $pageNo
* @param $pageSize
* @param $agentId
* @return false|\PDOStatement|string|\think\Collection
*/
public function getMyBuildingRoom($pageNo, $pageSize, $agentId){
$m_office_room = new OfficeGRoom();
$field = "a.id,a.area,a.price_total,a.price,a.station_start,a.station_end,a.decoration";
$params["b.agent_id"] = $agentId;
$params["b.type"] = 2;
$params["b.is_del"] = 0;
$res = $m_office_room->getMyBuildingRoom($field, $params,$pageSize,$pageNo);
if($res){
foreach ($res as $k=>$v) {
$res[$k]['price_total'] = $v['price_total'] * 0.01;
$res[$k]['price'] = $v['price'] * 0.01;
// $res[$k]['cover_image'] = $this->getCoverImage($v['id']);
}
}
return $res;
}
}
\ No newline at end of file
......@@ -377,7 +377,7 @@ class OfficeService
}
//房源封面图
private function getCoverImage($id){
public function getCoverImage($id){
if (CURRENT_URL == 'https://api.tonglianjituan.com/') {
$internet_path = IMAGES_URL.'/resource/lib/Attachments/images/';
}else {
......
......@@ -261,6 +261,31 @@ class OfficeGRoom extends BaseModel
return $result;
}
/**
* 我的办公楼
* @param $field
* @param $params
* @param $pageSize
* @param $pageNo
* @param string $order_
* @return false|\PDOStatement|string|\think\Collection
*/
public function getMyBuildingRoom($field, $params,$pageSize,$pageNo,$order_='id desc')
{
$result = Db::table($this->table)
->field($field)
->alias("a")
->join('office_g_building b', 'a.building_id = b.id', 'left')
->join('office_g_room_to_agent b', 'a.id = b.house_id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
return $result;
}
/**
* @param $page_no
* @param $page_size
......
......@@ -984,6 +984,7 @@ Route::group('office', [
'reportListForPc' => ['api_broker/OfficeReport/reportListForPc', ['method' => 'get']],
'getRoomListByReport' => ['api_broker/OfficeRoom/getRoomListByReport', ['method' => 'get|post']],
'addShopFollowUp' => ['api_broker/OfficeRoom/addShopFollowUp', ['method' => 'get|post']],
'getMyBuildingRoom' => ['api_broker/OfficeRoom/getMyBuildingRoom', ['method' => 'get|post']],
]);
Route::group('office_index', [
......
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