Commit 04393e43 authored by zhuwei's avatar zhuwei

C端 房源详情

parent 8b6dd4d6
<?php
namespace app\api\controller;
use app\api\extend\Basic;
use app\api\service\ActivityService;
use app\index\service\OfficeRoomService;
use think\Request;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-06-19
* Time: 14:38:58
*/
class OfficeRoom extends Basic
{
private $service;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service = new OfficeRoomService();
}
/**
* 房源详情
* @return \think\Response
*/
public function getOfficeRoomInfo()
{
$params = $this->params;
$checkResult = $this->validate($params, "OfficeRoomValidate.getOfficeRoomInfo");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$id = $params['id'];
$result = $this->service->getOfficeRoomInfo($id,1);
return $this->response($result['status'],$result['msg'], $result['data']);
}
}
\ No newline at end of file
...@@ -73,6 +73,7 @@ class Basic extends Controller ...@@ -73,6 +73,7 @@ class Basic extends Controller
"api/addUserCallAgentV2", "api/addUserCallAgentV2",
"office/filtrateConditionRoom", "office/filtrateConditionRoom",
"office_api/getBroker", "office_api/getBroker",
"office_api/getOfficeRoomInfo",
); );
/** /**
......
<?php
/**
* Created by fuju
* User : hj
* Date : 2017-12-7
* Time : 15:15:42
* Intro:
*/
namespace app\api\validate;
use think\Validate;
class OfficeRoomValidate extends Validate {
protected $rule = [
'id' => 'require|number|gt:0',
];
protected $message = [
'id.require' => 'id为必填字段',
'id.number' => 'id只能为数字',
'id.gt' => 'id必须大于0',
];
protected $scene = [
'getOfficeRoomInfo' => [ 'id' ],
];
}
\ No newline at end of file
...@@ -593,6 +593,7 @@ Route::group('api', [ ...@@ -593,6 +593,7 @@ Route::group('api', [
'getFindShop' => ['api/FindShop/getFindShopByParams', ['method' => 'get|post']], 'getFindShop' => ['api/FindShop/getFindShopByParams', ['method' => 'get|post']],
'getRecommendShopList' => ['api/FindShop/getRecommendShopList', ['method' => 'get|post']], 'getRecommendShopList' => ['api/FindShop/getRecommendShopList', ['method' => 'get|post']],
]); ]);
Route::group('chat', [ Route::group('chat', [
...@@ -1062,5 +1063,8 @@ Route::group('office_index', [ ...@@ -1062,5 +1063,8 @@ Route::group('office_index', [
Route::group('office_api', [ Route::group('office_api', [
'getBroker' => ['api/OfficeBroker/index', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表 'getBroker' => ['api/OfficeBroker/index', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表
'getBrokerV2' => ['api/OfficeBroker/indexV2', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表 'getBrokerV2' => ['api/OfficeBroker/indexV2', ['method' => 'get']], //获取当前商铺或街铺的经纪人评论信息列表
'getOfficeRoomInfo' => ['api/OfficeRoom/getOfficeRoomInfo', ['method' => 'GET|POST']],//获取房源详情
]); ]);
//Route::miss('api/index/miss');//处理错误的url //Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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