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
db00b150
Commit
db00b150
authored
Apr 11, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
记录客方修改记录
parent
bb8c274f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
14 deletions
+48
-14
Member.php
application/index/controller/Member.php
+23
-8
Basic.php
application/index/extend/Basic.php
+6
-4
Users.php
application/model/Users.php
+18
-1
user.js
public/resource/js/user.js
+1
-1
No files found.
application/index/controller/Member.php
View file @
db00b150
...
...
@@ -2,6 +2,7 @@
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\Users
;
use
app\model\UPhoneFollowPp
;
use
think\Request
;
...
...
@@ -212,17 +213,31 @@ class Member extends Basic{
public
function
pcEditClient
()
{
$data
=
[];
if
(
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'id'
])
{
if
(
$this
->
request
->
isPost
())
{
//编辑
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
$this
->
operating_records
(
$this
->
userId
,
$type
=
3
,
$remark
=
'用户编辑'
,
0
,
$this
->
params
[
'id'
]);
if
(
empty
(
$this
->
params
[
'user_nick'
])
||
empty
(
$this
->
params
[
'id'
]))
{
return
$this
->
response
(
101
,
'user_nick or user_phone or id is null'
);
}
if
(
$this
->
request
->
isPost
())
{
$user_data
=
$this
->
user
->
getUserById
(
'id,agent_id'
,
$this
->
params
[
'id'
]);
if
(
empty
(
$user_data
))
{
return
$this
->
response
(
101
,
'没有用户信息'
);
}
else
{
$data
[
'list'
]
=
$this
->
user
->
getClient
(
$this
->
params
[
'id'
]);
//是否修改客方
if
(
$this
->
params
[
'agents_id'
]
!=
$user_data
[
'agent_id'
])
{
$agent
=
new
AAgents
();
$agent_data
=
$agent
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$remark
=
'修改客方为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
}
else
{
$remark
=
'用户编辑'
;
}
}
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
//新增或编辑
$this
->
operating_records
(
$this
->
userId
,
$type
=
3
,
$remark
,
$this
->
params
[
'id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'user_nick or user_phone or id is null'
;
$data
[
'list'
]
=
$this
->
user
->
getClient
(
$this
->
params
[
'id'
]);
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$data
);
...
...
application/index/extend/Basic.php
View file @
db00b150
...
...
@@ -130,7 +130,7 @@ class Basic extends Controller
$is_auth
=
$agents
->
agentsAuth
(
$auth_id
,
$this
->
userId
);
$is_auth
=
empty
(
$is_auth
[
'id'
])
?
0
:
1
;
}
if
(
empty
(
$is_auth
)
&&
$this
->
userId
!=
1
)
{
if
(
$this
->
request
->
isAjax
()){
echo
json_encode
(
array
(
"code"
=>
"300"
,
"msg"
=>
"没有权限!"
,
"data"
=>
[],
"type"
=>
"json"
));
exit
;
...
...
@@ -215,11 +215,12 @@ class Basic extends Controller
* @param int $agents_id
* @param string $type
* @param string $remark
* @return bool|int|string
* @param string $user_id
* @return bool|false|int
*/
public
function
operating_records
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
)
{
public
function
operating_records
(
$agents_id
=
0
,
$type
=
''
,
$remark
=
''
,
$user_id
=
''
)
{
$records
=
new
GOperatingRecords
();
$result
=
$records
->
record
(
$agents_id
,
$type
,
$remark
);
$result
=
$records
->
record
(
$agents_id
,
$type
,
$remark
,
''
,
$user_id
);
return
$result
;
}
}
\ No newline at end of file
application/model/Users.php
View file @
db00b150
...
...
@@ -203,7 +203,6 @@ class Users extends Model
$insert_data
[
'status'
]
=
-
1
;
$insert_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$return_id
=
$this
->
save
(
$insert_data
);
$return_id
=
1
;
}
else
{
$return_id
=
-
1
;
}
...
...
@@ -401,4 +400,22 @@ class Users extends Model
}
}
/**
* 通过id获取用户信息
*
* @param string $field
* @param $id
* @param string $where
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getUserById
(
$field
=
'*'
,
$id
,
$where
=
''
)
{
return
$this
->
field
(
$field
)
->
where
(
'id'
,
$id
)
->
where
(
$where
)
->
find
();
}
}
public/resource/js/user.js
View file @
db00b150
...
...
@@ -4,6 +4,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
pageSize
:
15
,
/*每页显示多少条*/
user_id
:
0
,
urls
:
''
,
agent_id2
:
0
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
...
...
@@ -96,7 +97,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
$
(
"#cus_fang"
).
val
(
user_ht
);
$
(
".user-ul2"
).
html
(
''
);
user
.
agent_id2
=
$
(
obj
).
attr
(
"data-id"
);
},
search_phone
:
function
(){
//手机号
$
.
ajax
({
...
...
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