操作日志-登陆记录

master
chenzhi 5 years ago
parent 0e0a7263e3
commit 50e4185d9c

@ -1203,12 +1203,20 @@ class MemberController extends ThinkController
$this->assign('show_data_power', $show_data_power); $this->assign('show_data_power', $show_data_power);
parent::lists("UserLoginRecord", $p, $extend['map']); parent::lists("UserLoginRecord", $p, $extend['map']);
} }
//登陆记录删除
public function del($model = null, $ids = null) public function del($model = null, $ids = null)
{ {
$map = array(); $map = array();
if (isset($_REQUEST['id'])) { if (isset($_REQUEST['id'])) {
$map['id'] = $_REQUEST['id']; $map['id'] = $_REQUEST['id'];
//获取玩家账号
addOperationLog(array(
"op_type"=>2,
"key"=>M('user_login_record', 'tab_')->where($map)->field('user_account')->find()['user_account'],
"url"=>U("Member/login_record")
));
$data = M('user_login_record', 'tab_')->where($map)->delete(); $data = M('user_login_record', 'tab_')->where($map)->delete();
\Think\Log::actionLog('Member/del', 'Member', $_REQUEST['id']); \Think\Log::actionLog('Member/del', 'Member', $_REQUEST['id']);
$this->success('删除成功!', U('login_record'), 2); $this->success('删除成功!', U('login_record'), 2);
@ -1222,9 +1230,18 @@ class MemberController extends ThinkController
if (empty($ids)) { if (empty($ids)) {
$this->error('请选择要操作的数据!'); $this->error('请选择要操作的数据!');
} }
$ids = implode(",", $ids);
$list = M("user_login_record", "tab_"); $list = M("user_login_record", "tab_");
$map['id'] = array("in", $ids); $map['id'] = array("in", $ids);
//$map['status'] = 0; //操作日志
$lr = M("user_login_record", "tab_")->field('user_account')->where($map)->select();
foreach ($lr as $k => $v) {
addOperationLog(array(
"op_type"=>2,
"key"=>$v['user_account'],
"url"=>U("Member/login_record")
));
}
$delete = $list->where($map)->delete(); $delete = $list->where($map)->delete();
if ($delete) { if ($delete) {
\Think\Log::actionLog('Member/delprovide', 'Member', 1); \Think\Log::actionLog('Member/delprovide', 'Member', 1);

@ -142,7 +142,7 @@
<else/> <else/>
<volist name="list_data" id="data"> <volist name="list_data" id="data">
<tr> <tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td> <td>
<if condition="$show_data_power eq true "> <if condition="$show_data_power eq true ">
{$data.user_account} {$data.user_account}

@ -1372,3 +1372,7 @@ CREATE TABLE `tab_operation_log` (
`op_ip` varchar(16) DEFAULT '0' COMMENT '登陆ip', `op_ip` varchar(16) DEFAULT '0' COMMENT '登陆ip',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
-- 2020-02-25 chenzhi spend表索引优化
ALTER TABLE `tab_spend`
ADD INDEX `game_stayus` (`pay_status`, `pay_game_status`) USING BTREE ;

Loading…
Cancel
Save