Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
e598f971
Commit
e598f971
authored
May 31, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取房源详情
parent
f33d88af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
5 deletions
+87
-5
OfficeRoom.php
application/api_broker/controller/OfficeRoom.php
+21
-0
OfficeRoomValidate.php
application/api_broker/validate/OfficeRoomValidate.php
+19
-0
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+28
-0
OfficeGRoom.php
application/model/OfficeGRoom.php
+10
-0
route.php
application/route.php
+9
-5
No files found.
application/api_broker/controller/OfficeRoom.php
View file @
e598f971
...
...
@@ -81,4 +81,24 @@ class OfficeRoom extends Basic
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result_data
);
}
/**
* 房源详情
* @return \think\Response
*/
public
function
getOfficeRoomInfo
()
{
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"OfficeRoomValidate.modifyAgentPassword"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$broker_service
=
new
OfficeRoomService
();
$result
=
$broker_service
->
getOfficeRoomInfo
(
$params
);
return
$this
->
response
(
$result
[
'status'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
}
\ No newline at end of file
application/api_broker/validate/OfficeRoomValidate.php
0 → 100644
View file @
e598f971
<?php
namespace
app\api_broker\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'
],
];
}
application/index/service/OfficeRoomService.php
View file @
e598f971
...
...
@@ -548,4 +548,31 @@ class OfficeRoomService
}
return
$edit_phone
;
}
/**
* 获取房源详情
* @return array
*/
public
function
getOfficeRoomInfo
(
$params
){
$conditions
=
[];
if
(
!
isset
(
$params
[
'id'
])
or
!
$params
[
'id'
])
return
[
'status'
=>
101
,
'msg'
=>
'房源ID不能为空'
];
$conditions
[
'a.id'
]
=
$params
[
"id"
];
$field
=
'a.id'
;
$result
=
$this
->
m_office_room
->
getOfficeRoomInfo
(
$field
,
$conditions
);
if
(
!
$result
)
{
return
[
'status'
=>
101
,
'msg'
=>
'此房源不存在'
];
}
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
}
\ No newline at end of file
application/model/OfficeGRoom.php
View file @
e598f971
...
...
@@ -201,4 +201,14 @@ class OfficeGRoom extends BaseModel
->
where
(
$where
)
->
find
();
}
public
function
getOfficeRoomInfo
(
$field
,
$params
)
{
$result
=
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
where
(
$params
)
->
find
();
return
$result
;
}
}
application/route.php
View file @
e598f971
...
...
@@ -963,14 +963,17 @@ Route::group('office', [
'getCommission'
=>
[
'api_broker/OfficeOrderLog/getCommission'
,
[
'method'
=>
'GET|POST'
]],
'isShowAdjustment'
=>
[
'api_broker/OfficeOrderLog/isShowAdjustment'
,
[
'method'
=>
'GET|POST'
]],
'addBargain'
=>
[
'api_broker/OfficeOrderLog/addBargain'
,
[
'method'
=>
'post'
]],
//新增成交报告佣金(分佣提成)
'houseEdit'
=>
[
'api_broker/OfficeRoom/edit'
,
[
'method'
=>
'POST|GET'
]],
//楼盘字典新增和编辑
'delHouseFile'
=>
[
'index/OfficeRoom/delHouseFile'
,
[
'method'
=>
'POST'
]],
//删除楼盘图片
'houseEdit'
=>
[
'api_broker/OfficeRoom/edit'
,
[
'method'
=>
'POST'
]],
//楼盘字典新增和编辑
'getOfficeRoomInfo'
=>
[
'api_broker/OfficeRoom/getOfficeRoomInfo'
,
[
'method'
=>
'POST'
]
],
//获取房源详情
]);
Route
::
group
(
'office_index'
,
[
'houseDictionaryAdd'
=>
[
'index/OfficeManage/add'
,
[
'method'
=>
'GET|POST'
]],
//楼盘字典新增
'houseDictionaryEdit'
=>
[
'index/OfficeManage/edit'
,
[
'method'
=>
'GET|POST'
]],
//楼盘字典编辑
'delHouseFile'
=>
[
'index/OfficeManage/delHouseFile'
,
[
'method'
=>
'POST'
]],
//删除楼盘图片
'houseAdd'
=>
[
'index/OfficeManage/add'
,
[
'method'
=>
'GET|POST'
]
],
//楼盘字典新增
'houseEdit'
=>
[
'index/OfficeManage/edit'
,
[
'method'
=>
'GET|POST'
]
],
//楼盘字典编辑
'delHouseFile'
=>
[
'index/OfficeManage/delHouseFile'
,
[
'method'
=>
'POST'
]
],
//删除楼盘图片
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment