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
b9c15518
Commit
b9c15518
authored
Mar 01, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加编辑客户写入记录
parent
4996ec47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
Client.php
application/api_broker/controller/Client.php
+6
-0
Basic.php
application/api_broker/extend/Basic.php
+26
-1
GOperatingRecords.php
application/model/GOperatingRecords.php
+5
-5
No files found.
application/api_broker/controller/Client.php
View file @
b9c15518
...
@@ -45,15 +45,21 @@ class Client extends Basic
...
@@ -45,15 +45,21 @@ class Client extends Basic
if
(
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'id'
])
{
if
(
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'id'
])
{
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
params
[
'id'
])
{
if
(
$this
->
params
[
'id'
])
{
//编辑
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$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'
]);
}
else
{
}
else
{
//添加
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
);
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
);
if
(
$data
[
'start'
]
==
-
1
)
{
if
(
$data
[
'start'
]
==
-
1
)
{
$this
->
code
=
101
;
$this
->
code
=
101
;
$this
->
msg
=
'该用户已存在'
;
$this
->
msg
=
'该用户已存在'
;
}
}
if
(
$data
[
'start'
]
==
1
){
if
(
$data
[
'start'
]
==
1
){
$data
[
'id'
]
=
$this
->
user
->
id
;
$data
[
'id'
]
=
$this
->
user
->
id
;
$this
->
operating_records
(
$this
->
params
[
'agents_id'
],
$type
=
3
,
$remark
=
'用户添加'
,
0
,
$data
[
'id'
]);
}
else
{
}
else
{
$this
->
code
=
101
;
$this
->
code
=
101
;
$this
->
msg
=
'提交重复!'
;
$this
->
msg
=
'提交重复!'
;
...
...
application/api_broker/extend/Basic.php
View file @
b9c15518
...
@@ -11,6 +11,7 @@ namespace app\api_broker\extend;
...
@@ -11,6 +11,7 @@ namespace app\api_broker\extend;
*/
*/
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\GOperatingRecords
;
use
think\Controller
;
use
think\Controller
;
use
think\Request
;
use
think\Request
;
use
think\Response
;
use
think\Response
;
...
@@ -96,6 +97,12 @@ class Basic extends Controller
...
@@ -96,6 +97,12 @@ class Basic extends Controller
}
}
}
}
/**
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
verifyAgentInfo
()
public
function
verifyAgentInfo
()
{
{
$agentModel
=
new
AAgents
();
$agentModel
=
new
AAgents
();
...
@@ -212,7 +219,7 @@ class Basic extends Controller
...
@@ -212,7 +219,7 @@ class Basic extends Controller
}
}
/**
/**
* Cors Request Header信息
*
Cors Request Header信息
* @return array
* @return array
*/
*/
public
static
function
corsRequestHander
()
public
static
function
corsRequestHander
()
...
@@ -227,6 +234,24 @@ class Basic extends Controller
...
@@ -227,6 +234,24 @@ class Basic extends Controller
}
}
/**
* 记录操作
* @param int $agents_id
* @param int $house_id
* @param string $type
* @param string $remark
* @param int $user_id
* @return bool|false|int
*/
public
function
operating_records
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
,
$house_id
=
0
,
$user_id
=
0
)
{
$records
=
new
GOperatingRecords
();
$result
=
$records
->
record
(
$agents_id
,
$type
,
$remark
,
$house_id
,
$user_id
);
return
$result
;
}
}
}
application/model/GOperatingRecords.php
View file @
b9c15518
...
@@ -15,16 +15,15 @@ use think\Session;
...
@@ -15,16 +15,15 @@ use think\Session;
class
GOperatingRecords
extends
BaseModel
class
GOperatingRecords
extends
BaseModel
{
{
/**
/**日志
* 行为日志记录
*
* @param int $agents_id
* @param int $agents_id
* @param string $type
* @param string $type
* @param string $remark
* @param string $remark
* @param $houses_id
* @param string $houses_id
* @param int $user_id
* @return bool|false|int
* @return bool|false|int
*/
*/
public
function
record
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
,
$houses_id
=
''
)
public
function
record
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
,
$houses_id
=
''
,
$user_id
=
0
)
{
{
$result
=
false
;
$result
=
false
;
$agents_id
=
$agents_id
?
$agents_id
:
Session
::
get
(
'userId'
);
$agents_id
=
$agents_id
?
$agents_id
:
Session
::
get
(
'userId'
);
...
@@ -41,6 +40,7 @@ class GOperatingRecords extends BaseModel
...
@@ -41,6 +40,7 @@ class GOperatingRecords extends BaseModel
'ip'
=>
$request
->
ip
(),
'ip'
=>
$request
->
ip
(),
'remark'
=>
$remark
,
'remark'
=>
$remark
,
'houses_id'
=>
$houses_id
,
'houses_id'
=>
$houses_id
,
'user_id'
=>
$user_id
,
'type'
=>
$type
,
'type'
=>
$type
,
'create_time'
=>
date
(
'Y-m-d H:i:s'
),
'create_time'
=>
date
(
'Y-m-d H:i:s'
),
];
];
...
...
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