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
fe19baae
Commit
fe19baae
authored
Apr 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量修改客方
parent
d9a6b376
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
4 deletions
+41
-4
Member.php
application/index/controller/Member.php
+31
-4
Users.php
application/model/Users.php
+9
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Member.php
View file @
fe19baae
...
...
@@ -28,10 +28,6 @@ class Member extends Basic{
}
public
function
index
()
{
return
view
(
'member/users_list'
);
}
/**
* 用户列表
*
...
...
@@ -324,4 +320,35 @@ class Member extends Basic{
$data
=
$this
->
user
->
delete_user
(
$id
);
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 批量修改客方
*
* @return \think\Response
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
batchEditCustomer
()
{
if
(
empty
(
$this
->
params
[
'old_agents_id'
])
||
empty
(
$this
->
params
[
'agents_id'
]))
{
return
$this
->
response
(
101
,
'经纪人信息错误'
);
}
$user
=
new
Users
();
$user
->
startTrans
();
$user
->
lock
(
true
);
$user_data
=
$user
->
getUserByWhere
([
'agent_id'
=>
$this
->
params
[
'old_agents_id'
]],
'id'
);
$user_data_arr
=
[];
foreach
(
$user_data
as
$k
=>
$v
)
{
$user_data_arr
[
$k
][
'id'
]
=
$v
[
'id'
];
$user_data_arr
[
$k
][
'agent_id'
]
=
$this
->
params
[
'agents_id'
];
}
$total
=
$user
->
updateUserAll
(
$user_data_arr
);
$user
->
commit
();
return
$this
->
response
(
200
,
''
,
[
'total'
=>
count
(
$total
)]);
}
}
application/model/Users.php
View file @
fe19baae
...
...
@@ -468,4 +468,13 @@ class Users extends Model
return
$data
;
}
/**
* @param $data
* @return array|false
* @throws \Exception
*/
public
function
updateUserAll
(
$data
)
{
return
$this
->
saveAll
(
$data
);
}
}
application/route.php
View file @
fe19baae
...
...
@@ -66,6 +66,7 @@ Route::group('index', [
'del_user'
=>
[
'index/member/delUser'
,[
'method'
=>
'post'
]],
'pcAddFollow'
=>
[
'index/member/pcAddFollow'
,[
'method'
=>
'post'
]],
'pcEditClient'
=>
[
'index/member/pcEditClient'
,[
'method'
=>
'post | get'
]],
'batchEditCustomer'
=>
[
'index/member/batchEditCustomer'
,[
'method'
=>
'post'
]],
//批量修改客方
//transfer转铺列表
'transfer_list'
=>
[
'index/transfer/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