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
3ec525fb
Commit
3ec525fb
authored
Dec 12, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证token
parent
0191fac1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
5 deletions
+81
-5
Banner.php
application/api/controller/Banner.php
+5
-1
Index.php
application/api/controller/Index.php
+1
-1
Sublet.php
application/api/controller/Sublet.php
+51
-0
Basic.php
application/api/extend/Basic.php
+8
-2
SubletModel.php
application/model/SubletModel.php
+16
-1
No files found.
application/api/controller/Banner.php
View file @
3ec525fb
...
...
@@ -7,7 +7,7 @@ namespace app\api\controller;
* User : zw
* Date : 2017/12/8
* Time : 11:07
* Intro:
* Intro:
banner增删改查
*/
use
app\api\extend\Basic
;
...
...
@@ -57,6 +57,10 @@ class Banner extends Basic
}
}
/**
* 修改是否显示
* @return \think\Response
*/
public
function
upIsShow
()
{
$params
=
array
(
...
...
application/api/controller/Index.php
View file @
3ec525fb
...
...
@@ -4,7 +4,7 @@
* User : zw
* Date : 2017/12/7
* Time : 15:16
* Intro: c端首页资源
banner
月均价 上周成交量
* Intro: c端首页资源 月均价 上周成交量
*/
namespace
app\api\controller
;
...
...
application/api/controller/Sublet.php
0 → 100644
View file @
3ec525fb
<?php
namespace
app\api\controller
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2017/12/12
* Time : 10:39
* Intro:
*/
use
app\api\extend\Basic
;
use
app\model\SubletModel
;
use
think\Request
;
class
Sublet
extends
Basic
{
protected
$subletMode
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
subletMode
=
new
SubletModel
();
}
public
function
addSublet
(){
//$params = $this->params;
/**
* `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '我的转租记录表',
`user_id` int(10) DEFAULT NULL COMMENT '用户id',
`manage_status` tinyint(3) DEFAULT '0' COMMENT '经营状态 0:餐饮美食 1:零售 2:休闲娱乐 3:其他',
`address_detail` varchar(255) DEFAULT '' COMMENT '详细地址',
`province` varchar(125) DEFAULT NULL COMMENT '省',
`province_code` int(10) DEFAULT NULL COMMENT '省code 对应regions表code',
`city` varchar(125) DEFAULT '' COMMENT '市',
`city_id` int(10) DEFAULT NULL COMMENT '市id',
`district` varchar(125) DEFAULT '' COMMENT '区',
`district_id` int(10) DEFAULT NULL COMMENT '区id',
`expected_rent` int(11) DEFAULT '0' COMMENT '期望租金 存分',
`appellation` varchar(125) DEFAULT '' COMMENT '称呼',
`tel` varchar(20) DEFAULT '' COMMENT '联系方式',
`status` tinyint(3) DEFAULT '0' COMMENT '状态 0:已发布 1:电话核实 2:商铺上架',
`agents_id` int(10) DEFAULT NULL COMMENT '经纪人 对应agents表(对接经纪人)',
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
*/
$params
=
array
(
);
}
}
application/api/extend/Basic.php
View file @
3ec525fb
...
...
@@ -14,6 +14,7 @@ use think\helper\Time;
use
think\Request
;
use
think\Response
;
use
Qiniu
;
use
think\Session
;
class
Basic
extends
Controller
{
...
...
@@ -62,9 +63,9 @@ class Basic extends Controller
}
$jwt
=
new
\Firebase\JWT\JWT
();
/*
$jwt = new \Firebase\JWT\JWT();
/*
$this->authToken = $this->params['AuthToken'];
$this->authToken = $this->params['AuthToken'];
$result = $jwt->decode($this->authToken, config('jwt_key'), array( 'HS256' )); //解码token
$this->userId = $result['data']["userId"];
$this->phone = $result['data']["phone"];
...
...
@@ -84,6 +85,11 @@ class Basic extends Controller
}
public
function
verifyUserInfo
(){
//todo 待完成
$userArr
=
Session
::
get
(
"u_user"
);
if
(
count
(
$userArr
)
>
0
&&
(
$userArr
[
"status"
]
!=
0
||
$userArr
[
"id"
]
!=
$this
->
userId
||
$userArr
[
"user_phone"
]
!=
$this
->
phone
)
){
$this
->
response
(
"101"
,
"用户验证失败,重新登录!"
);
}
return
true
;
}
...
...
application/model/Sublet.php
→
application/model/Sublet
Model
.php
View file @
3ec525fb
...
...
@@ -4,8 +4,23 @@ namespace app\model;
use
think\Model
;
class
Sublet
extends
Model
class
Sublet
Model
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_sublet'
;
protected
$db
;
function
__construct
()
{
$this
->
db
=
Db
(
$this
->
table
);
}
public
function
addSublet
(
$params
)
{
//todo 新增
}
}
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