Commit 4f036d3d authored by zhuwei's avatar zhuwei

1

parent dccaaa06
......@@ -260,8 +260,7 @@ class OfficeRoom extends Basic
$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);
return $this->response($result['status'],$result['msg'], $result['data']);
}
/**
......
......@@ -616,7 +616,7 @@ class OfficeRoomService
$result = $this->m_office_room->getOfficeRoomInfo($field,['a.id'=>$id]);
if (!$result) {
return ['status'=>101,'msg'=>'此房源不存在',''];
return ['status'=>101,'msg'=>'此房源不存在','data'=>''];
}
$result['price'] = $result['price'] * 0.01;
......@@ -1112,19 +1112,20 @@ class OfficeRoomService
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;
$params["c.agent_id"] = $agentId;
$params["c.type"] = 2;
$params["c.is_del"] = 0;
$res = $m_office_room->getMyBuildingRoom($field, $params,$pageSize,$pageNo);
if (!$res) {
return ['status'=>101,'msg'=>'此房源不存在','data'=>''];
}
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;
return ['status'=>200,'msg'=>'success','data'=>$res];
}
/**
......
......@@ -276,13 +276,12 @@ class OfficeGRoom extends BaseModel
->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')
->join('office_g_room_to_agent c', 'a.id = c.house_id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
return $result;
}
......
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