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
92e65e81
Commit
92e65e81
authored
Jun 22, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委托转铺
parent
c52fc7ab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
15 deletions
+46
-15
RedisController.php
application/api/controller/RedisController.php
+1
-0
Sublet.php
application/api/controller/Sublet.php
+44
-15
route.php
application/route.php
+1
-0
No files found.
application/api/controller/RedisController.php
View file @
92e65e81
...
@@ -4,6 +4,7 @@ namespace app\api\controller;
...
@@ -4,6 +4,7 @@ namespace app\api\controller;
use
app\extra\RedisExt
;
use
app\extra\RedisExt
;
use
think\cache\driver\Redis
;
use
think\cache\driver\Redis
;
use
think\queue\Job
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
...
application/api/controller/Sublet.php
View file @
92e65e81
...
@@ -23,25 +23,54 @@ class Sublet extends Basic
...
@@ -23,25 +23,54 @@ class Sublet extends Basic
$this
->
subletMode
=
new
SubletModel
();
$this
->
subletMode
=
new
SubletModel
();
}
}
/**
* 委托转铺列表
* @return \think\Response
*/
public
function
subletList
()
{
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 1,
"page_no" => 1,
"page_size" => 15
);*/
$user_id
=
$params
[
"user_id"
];
if
(
!
$user_id
)
{
return
$this
->
response
(
"101"
,
"用户id不能为空"
);
}
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$pageSize
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$select_
[
"user_id"
]
=
$user_id
;
$fields
=
'id,manage_type,address_detail,FORMAT(expected_rent/100,2) as expected_rent,create_time,status,house_id'
;
$result
=
$this
->
subletMode
->
getSublet
(
$pageNo
,
$pageSize
,
"id desc"
,
$fields
,
$select_
);
if
(
count
(
$result
)
>
0
)
return
$this
->
response
(
"200"
,
"success"
,
$result
);
return
$this
->
response
(
"101"
,
"请求异常,请稍后再试"
);
}
public
function
addSublet
()
public
function
addSublet
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"user_id" => 47,
"user_id" => 47,
"manage_type" => 美食,
"manage_type" => 美食,
"address_detail" => "泗泾",
"address_detail" => "泗泾",
"province" => "上海",
"province" => "上海",
"city" => "长沙市",
"city" => "长沙市",
"district" => "芙蓉区",
"district" => "芙蓉区",
"expected_rent" => 2000,
"expected_rent" => 2000,
"appellation" => "zhangsan",
"appellation" => "zhangsan",
"tel" => 13817616162,
"tel" => 13817616162,
"AuthToken" => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo0NywidXNlck5pY2siOm51bGwsInBob25lIjoiMTgyMDU2MjUwMjAifSwidGltZVN0YW1wXyI6MTUxMzU3MzMwMH0.-_tpSDeucA6_V8glS1hfoNBpZU8lRk6J8On3-_Rdf_I',
"AuthToken" => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjo0NywidXNlck5pY2siOm51bGwsInBob25lIjoiMTgyMDU2MjUwMjAifSwidGltZVN0YW1wXyI6MTUxMzU3MzMwMH0.-_tpSDeucA6_V8glS1hfoNBpZU8lRk6J8On3-_Rdf_I',
);*/
);*/
if
(
!
isset
(
$params
[
"manage_type"
]))
{
if
(
!
isset
(
$params
[
"manage_type"
]))
{
return
$this
->
response
(
"101"
,
"经营业态不能为空"
);
return
$this
->
response
(
"101"
,
"经营业态不能为空"
);
}
}
if
(
!
isset
(
$params
[
"address_detail"
]))
{
if
(
!
isset
(
$params
[
"address_detail"
]))
{
...
@@ -59,8 +88,8 @@ class Sublet extends Basic
...
@@ -59,8 +88,8 @@ class Sublet extends Basic
if
(
!
isset
(
$params
[
"expected_rent"
]))
{
if
(
!
isset
(
$params
[
"expected_rent"
]))
{
return
$this
->
response
(
"101"
,
"期望租金不能为空"
);
return
$this
->
response
(
"101"
,
"期望租金不能为空"
);
}
else
{
}
else
{
$params
[
"expected_rent"
]
=
$params
[
"expected_rent"
]
*
100
;
$params
[
"expected_rent"
]
=
$params
[
"expected_rent"
]
*
100
;
}
}
if
(
!
isset
(
$params
[
"appellation"
]))
{
if
(
!
isset
(
$params
[
"appellation"
]))
{
...
...
application/route.php
View file @
92e65e81
...
@@ -308,6 +308,7 @@ Route::group('api', [
...
@@ -308,6 +308,7 @@ Route::group('api', [
'addSublet'
=>
[
'api/Sublet/addSublet'
,
[
'method'
=>
'post|get'
]
],
'addSublet'
=>
[
'api/Sublet/addSublet'
,
[
'method'
=>
'post|get'
]
],
'subletList'
=>
[
'api/Sublet/subletList'
,
[
'method'
=>
'post|get'
]
],
//委托转铺列表
//Version
//Version
...
...
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