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
13eb7d1b
Commit
13eb7d1b
authored
Mar 01, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户标签列表
parent
b9c15518
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
166 additions
and
23 deletions
+166
-23
Client.php
application/api_broker/controller/Client.php
+2
-3
Basic.php
application/api_broker/extend/Basic.php
+20
-16
Auth.php
application/index/controller/Auth.php
+3
-0
Label.php
application/index/controller/Label.php
+87
-1
GOperatingRecords.php
application/model/GOperatingRecords.php
+4
-2
ULabels.php
application/model/ULabels.php
+42
-0
Users.php
application/model/Users.php
+4
-1
route.php
application/route.php
+4
-0
No files found.
application/api_broker/controller/Client.php
View file @
13eb7d1b
...
...
@@ -47,7 +47,7 @@ class Client extends Basic
if
(
$this
->
params
[
'id'
])
{
//编辑
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
$this
->
operating_records
(
$this
->
params
[
'
agents
_id'
],
$type
=
3
,
$remark
=
'用户编辑'
,
0
,
$this
->
params
[
'id'
]);
$this
->
operating_records
(
$this
->
params
[
'
ccr
_id'
],
$type
=
3
,
$remark
=
'用户编辑'
,
0
,
$this
->
params
[
'id'
]);
}
else
{
//添加
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
);
...
...
@@ -58,8 +58,7 @@ class Client extends Basic
if
(
$data
[
'start'
]
==
1
){
$data
[
'id'
]
=
$this
->
user
->
id
;
$this
->
operating_records
(
$this
->
params
[
'agents_id'
],
$type
=
3
,
$remark
=
'用户添加'
,
0
,
$data
[
'id'
]);
$this
->
operating_records
(
$this
->
params
[
'ccr_id'
],
$type
=
3
,
$remark
=
'用户添加'
,
0
,
$data
[
'id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'提交重复!'
;
...
...
application/api_broker/extend/Basic.php
View file @
13eb7d1b
...
...
@@ -37,13 +37,17 @@ class Basic extends Controller
protected
$agentPhone
;
protected
$timeStamp_
;
protected
$filterVerify
=
array
(
'broker/login'
);
/**
* 基础接口SDK
* @param Request|null $request
*/
/**
* Basic constructor.
* @param Request|null $request
*/
public
function
__construct
(
Request
$request
=
null
)
{
// CORS 跨域 Options 检测响应
...
...
@@ -56,21 +60,21 @@ class Basic extends Controller
}
elseif
(
strtoupper
(
$this
->
request
->
method
())
===
"POST"
)
{
$this
->
params
=
$this
->
request
->
param
()
!=
null
?
$this
->
request
->
param
()
:
null
;
}
/
*
if (isset($this->params['AuthToken']) && $this->params['AuthToken'] != 'null' && !empty($this->params['AuthToken'])) {
$jwt = new \Firebase\JWT\JWT();
$this->authToken = $this->params['AuthToken'];
$result = $jwt->decode($this->authToken, config('jwt_key'), array( 'HS256' )); //解码token
$this->user
Id = $result->data->id;
$this->p
hone = $result->data->phone;
$this->userNick
= $result->data->userNick;
$this->timeStamp_ = $result->timeStamp_;
}
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
}*/
/
/
if (isset($this->params['AuthToken']) && $this->params['AuthToken'] != 'null' && !empty($this->params['AuthToken'])) {
//
$jwt = new \Firebase\JWT\JWT();
//
$this->authToken = $this->params['AuthToken'];
//
$result = $jwt->decode($this->authToken, config('jwt_key'), array( 'HS256' )); //解码token
// $this->agent
Id = $result->data->id;
// $this->agentP
hone = $result->data->phone;
// $this->agentName
= $result->data->userNick;
//
$this->timeStamp_ = $result->timeStamp_;
//
}
//
//
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//
//过滤掉不需要验证token的接口
//
if (!in_array(trim($requestPath), $this->filterVerify)) {
//
$this->tokenVerify();
// }
}
...
...
application/index/controller/Auth.php
View file @
13eb7d1b
...
...
@@ -45,6 +45,9 @@ class Auth extends Basic
/**
* 角色列表接口
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAuth
()
{
$data
[
'status'
]
=
200
;
...
...
application/index/controller/Label.php
View file @
13eb7d1b
...
...
@@ -11,6 +11,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\model\GLabels
;
use
app\model\ULabels
;
use
think\Session
;
class
Label
extends
Basic
...
...
@@ -18,8 +19,10 @@ class Label extends Basic
/**
* 添加标签
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
(){
$result
[
'code'
]
=
200
;
...
...
@@ -53,6 +56,13 @@ class Label extends Basic
return
$return
;
}
/**
* 楼盘标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getLabelsList
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
...
...
@@ -66,4 +76,79 @@ class Label extends Basic
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
//*****************************************************************************************用户标签
//用户标签页面
public
function
uLabelIndex
(){
return
view
(
'u_label_index'
);
}
/**用户添加编辑
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
updateULabel
(){
$group_id
=
$this
->
request
->
param
(
'id'
);
$table
=
New
ULabels
;
if
(
$this
->
request
->
isPost
())
{
$data
=
input
(
'post.'
);
if
(
$table
->
repetition
(
'name'
,
$data
[
'name'
])
&&
empty
(
$data
[
'id'
])){
return
$this
->
response
(
100
,
'url存在重复值'
);
}
//新增或者编辑数据
if
(
empty
(
$data
[
'id'
])){
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$id
=
''
;
}
else
{
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$id
=
$data
[
'id'
];
}
//新增或者编辑数据
//prt($data)
if
(
$table
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
100
,
'无修改'
);
}
}
else
{
$where
=
"id=
{
$group_id
}
"
;
$info
=
$table
->
uleList
(
$where
);
//echo $table->getLastSql();
return
$this
->
response
(
200
,
'成功'
,
$info
[
0
]);
}
}
/**
* 用户标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getULabelsList
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$labels
=
new
GLabels
();
$field
=
'id,name,create_time'
;
$where
[
'type'
]
=
0
;
$result
[
'data'
][
'list'
]
=
$labels
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$result
[
'data'
][
'total'
]
=
$labels
->
getTotal
(
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
}
\ No newline at end of file
application/model/GOperatingRecords.php
View file @
13eb7d1b
...
...
@@ -30,9 +30,11 @@ class GOperatingRecords extends BaseModel
if
(
$agents_id
>
0
)
{
$request
=
Request
::
instance
();
$name
=
Session
::
get
(
'userName'
);
if
(
$name
)
{
$name
=
db
(
'a_agents'
)
->
where
(
'id'
,
$agents_id
)
->
value
(
'name'
);
if
(
empty
(
$name
))
{
$name
=
db
(
'agents'
)
->
where
(
'id'
,
$agents_id
)
->
value
(
'realname'
);
}
$data
=
[
'agents_id'
=>
$agents_id
,
'name'
=>
$name
,
...
...
application/model/ULabels.php
0 → 100644
View file @
13eb7d1b
<?php
namespace
app\model
;
class
ULabels
extends
BaseModel
{
/**
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
uleList
(
$where
)
{
return
$this
->
where
(
$where
)
->
select
();
}
/**检查重复
* @param $name
* @param $key
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
repetition
(
$name
,
$key
){
$r
=
$this
->
field
(
$name
)
->
where
(
$name
,
'='
,
$key
)
->
select
();
//$this->getLastSql();
if
(
$r
){
return
true
;
}
else
{
return
false
;
}
}
}
application/model/Users.php
View file @
13eb7d1b
...
...
@@ -101,7 +101,10 @@ class Users extends Model
*/
public
function
edit
(
$data
,
$id
=
0
)
{
$insert_data
[
'user_nick'
]
=
$data
[
'user_nick'
];
$insert_data
[
'user_phone'
]
=
$data
[
'user_phone'
];
if
(
$data
[
'user_phone'
]){
$insert_data
[
'user_phone'
]
=
$data
[
'user_phone'
];
}
$insert_data
[
'sex'
]
=
$data
[
'sex'
];
if
(
$id
)
{
...
...
application/route.php
View file @
13eb7d1b
...
...
@@ -107,6 +107,10 @@ Route::group('index', [
'updateStatus'
=>
[
'index/agent/updateStatus'
,
[
'method'
=>
'post'
]],
//状态修改【接口】
'updateRole'
=>
[
'index/agent/updateRole'
,
[
'method'
=>
'post'
]],
//经纪人角色修改【接口】
//客户标签
'uLabelIndex'
=>
[
'index/label/uLabelIndex'
,[
'method'
=>
'get'
]],
//客户标签界面
'getULabelsList'
=>
[
'index/label/getULabelsList'
,[
'method'
=>
'get'
]],
//客户标签列表接口
'updateULabel'
=>
[
'index/label/updateULabel'
,[
'method'
=>
'post|get'
]],
//编辑添加客户标签
//商圈
'BusinessDistrict'
=>
[
'index/BusinessDistrict/index'
,
[
'method'
=>
'get'
]],
//商圈列表
...
...
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