优化批量操作

master
chenzhi 5 years ago
parent 02407d1c50
commit 2de1d9bccb

@ -1235,7 +1235,7 @@ class MemberController extends ThinkController
{ {
if ($accounts) $map['account'] = ['in', array_unique(explode("\n", $accounts))]; if ($accounts) $map['account'] = ['in', array_unique(explode("\n", $accounts))];
if ($id) $map['id'] = ['in', array_unique(explode("\n", $id))]; if ($id) $map['id'] = ['in', array_unique(explode("\n", $id))];
$users = M('user', 'tab_')->where($map)->field('id')->select(); $users = M('user', 'tab_')->where($map)->field('id,lock_status')->select();
if($_POST['lock_remark']){ if($_POST['lock_remark']){
$res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status,"lock_remark" => $_POST['lock_remark']]); $res = M('user', 'tab_')->where($map)->setField(['lock_status' => $lock_status,"lock_remark" => $_POST['lock_remark']]);
}else{ }else{
@ -1244,10 +1244,11 @@ class MemberController extends ThinkController
if ($res) { if ($res) {
foreach ($users as $item) { foreach ($users as $item) {
if($item['lock_status'] != $lock_status){
$this->userEditOperationLog($item['id'],"锁定/解锁");
}
\Think\Log::actionLog('Member/lock_status', 'Member', $item['id']); \Think\Log::actionLog('Member/lock_status', 'Member', $item['id']);
} }
$this->userEditOperationLog($id,"锁定/解锁");
$this->success('操作成功!'); $this->success('操作成功!');
} else { } else {
$this->error('操作失败!'); $this->error('操作失败!');

Loading…
Cancel
Save