|
|
@@ -57,7 +57,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
{checkbox: true},
|
|
|
{field: 'user_id', title: __('User_id'), sortable: true},
|
|
|
{field: 'user_wallet_address', title: __('User_wallet_address'), operate: 'LIKE'},
|
|
|
- {field: 'user_chain', title: __('User_chain'), operate: false},
|
|
|
+ {field: 'user_chain', title: __('User_chain'), formatter: Table.api.formatter.status, searchList: {1: 'ETH', 2: 'TRON'}, operate: false},
|
|
|
{field: 'avatar', title: __('User_avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
|
|
|
{field: 'user_nickname', title: __('User_nickname'), operate: 'LIKE'},
|
|
|
{field: 'user_house_level', title: __('User_house_level'), operate: false},
|
|
|
@@ -65,16 +65,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
{field: 'user_usdt_amount', title: __('User_usdt_amount'), operate: false},
|
|
|
{field: 'user_withdraw', title: __('User_withdraw'), operate: false},
|
|
|
{field: 'user_invitation', title: __('User_invitation'), operate: false},
|
|
|
- {field: 'user_type', title: __('User_type'), formatter: Table.api.formatter.status, searchList: {1: __('User_type_1'), 2: __('User_type_2')}},
|
|
|
+ {field: 'user_type', title: __('User_type'), formatter: Table.api.formatter.status, searchList: {1: __('User_type_1'), 0: __('User_type_2')}},
|
|
|
{field: 'useracting.nickname', title: __('User_acting'), operate: false},
|
|
|
-
|
|
|
+ {field: 'user_memo', title: __('User_memo')},
|
|
|
{field: 'gold_coin', title: __('Gold_coin'), operate: false, events: operateEvents, formatter:function(value, row, index) {
|
|
|
- if (row.givegold) {
|
|
|
- return row.givegold.gg_name + ' <button type="button" class="btn btn-embossed btn-goldcoin" >编辑</button>';
|
|
|
+ if (Config.role==0) {
|
|
|
+ if (row.givegold) {
|
|
|
+ return row.givegold.gg_name + ' <button type="button" class="btn btn-embossed btn-goldcoin" >编辑</button>';
|
|
|
+ } else {
|
|
|
+ return '<button type="button" class="btn btn-embossed btn-goldcoin" >编辑</button>';
|
|
|
+ }
|
|
|
} else {
|
|
|
- return '<button type="button" class="btn btn-embossed btn-goldcoin" >编辑</button>';
|
|
|
+ table.data("gold_coin", null);
|
|
|
+ //return;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -83,9 +87,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
return '<a class="btn btn-addtabs btn-notice" href="user.user/look?user_id='+row.user_id+'" data-name="" ><i class="fa fa-circle-o"></i>查看</a>' +
|
|
|
'<a class="btn btn-addtabs btn-notice" href="user.user/edituser?user_id='+row.user_id+'" data-name="" ><i class="fa fa-pencil"></i>修改</a>';
|
|
|
} else {
|
|
|
- return '<a class="btn btn-addtabs btn-notice" href="user.user/look?user_id='+row.user_id+'" data-name="" ><i class="fa fa-circle-o"></i>查看</a>' +
|
|
|
- '<a class="btn btn-addtabs btn-notice" href="user.user/edituser?user_id='+row.user_id+'" data-name="" ><i class="fa fa-pencil"></i>修改</a>' +
|
|
|
- '<button type="button" class="btn btn-embossed btn-totype btn-primary" >转为测试号</button>';
|
|
|
+ if (Config.role==0) {
|
|
|
+ return '<a class="btn btn-addtabs btn-notice" href="user.user/look?user_id='+row.user_id+'" data-name="" ><i class="fa fa-circle-o"></i>查看</a>' +
|
|
|
+ '<a class="btn btn-addtabs btn-notice" href="user.user/edituser?user_id='+row.user_id+'" data-name="" ><i class="fa fa-pencil"></i>修改</a>' +
|
|
|
+ '<button type="button" class="btn btn-embossed btn-totype btn-primary" >转为测试号</button>';
|
|
|
+ } else {
|
|
|
+ return '<a class="btn btn-addtabs btn-notice" href="user.user/look?user_id='+row.user_id+'" data-name="" ><i class="fa fa-circle-o"></i>查看</a>' +
|
|
|
+ '<a class="btn btn-addtabs btn-notice" href="user.user/edituser?user_id='+row.user_id+'" data-name="" ><i class="fa fa-pencil"></i>修改</a>';
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -299,6 +309,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
this.layerIndex = index;
|
|
|
});
|
|
|
$(document).on('click', '#c-user_erc20_usdt', function () {
|
|
|
+ if ($('#user_type').val() == 0) {
|
|
|
+ alert('普通用户不能修改');
|
|
|
+ return;
|
|
|
+ }
|
|
|
var _params = {
|
|
|
type: 'user_erc20_usdt',
|
|
|
user_id: $('#user_id').val(),
|
|
|
@@ -324,6 +338,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
});
|
|
|
this.layerIndex = index;
|
|
|
});
|
|
|
+ $(document).on('click', '#c-user_memo', function () {
|
|
|
+ var _params = {
|
|
|
+ type: 'user_memo',
|
|
|
+ user_id: $('#user_id').val(),
|
|
|
+ };
|
|
|
+ var index = layer.open({
|
|
|
+ type: 2,
|
|
|
+ title: __('User_memo'),
|
|
|
+ area: ["400px", "300px"],
|
|
|
+ content: Fast.api.fixurl('user/user/usergivegold?user_id=' + _params.user_id + '&type=' + _params.type)
|
|
|
+ });
|
|
|
+ this.layerIndex = index;
|
|
|
+ });
|
|
|
},
|
|
|
givegold: function () {
|
|
|
function getAbcClass(value, row, index) {
|
|
|
@@ -354,6 +381,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
data: _params,
|
|
|
success: function (ret) {
|
|
|
alert(ret.msg);
|
|
|
+ window.location.reload();
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}
|
|
|
@@ -411,6 +439,109 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
data: _params,
|
|
|
success: function (ret) {
|
|
|
alert(ret.msg);
|
|
|
+ window.location.reload();
|
|
|
+ },
|
|
|
+ error: function (e) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ // 为表格绑定事件
|
|
|
+ Table.api.bindevent(table);
|
|
|
+ },
|
|
|
+ fee: function () {
|
|
|
+ function getAbcClass(value, row, index) {
|
|
|
+ var contentObj = $("<select class='abcClass'></select>");
|
|
|
+ $.each(row.fee, function(index, obj){
|
|
|
+ var optionObj = contentObj.append("<option></option>").children("option").last();
|
|
|
+ var fee_id = obj.fee_id;
|
|
|
+ if (obj.fee_isdefault==1) {
|
|
|
+ fee_id = 0;
|
|
|
+ }
|
|
|
+ optionObj.attr("value", fee_id).text(obj.fee_name);
|
|
|
+ if (obj.fee_id == row.user_fee_id) {
|
|
|
+ optionObj.attr("selected", "selected");
|
|
|
+ $("#abcClass").children().eq(index).attr("selected", "selected");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return "移至 <select class='abcClass' index="+index+">"+contentObj.html()+"</select>";
|
|
|
+ }
|
|
|
+ window.actionEvents = {
|
|
|
+ 'change .abcClass':function(e,value,row,index){
|
|
|
+ if(!value){
|
|
|
+ value = e.currentTarget.value;
|
|
|
+ }
|
|
|
+ var _params = {
|
|
|
+ id: row.user_id,
|
|
|
+ fee_id: value,
|
|
|
+ };
|
|
|
+ $.ajax({
|
|
|
+ dataType: 'json',
|
|
|
+ type: 'POST',
|
|
|
+ url: 'user/user/feeedit',
|
|
|
+ data: _params,
|
|
|
+ success: function (ret) {
|
|
|
+ alert(ret.msg);
|
|
|
+ window.location.reload();
|
|
|
+ },
|
|
|
+ error: function (e) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 初始化表格参数配置
|
|
|
+ Table.api.init({
|
|
|
+ extend: {
|
|
|
+ index_url: 'user/user/fee?fee_id=' + $('#fee_id').val(),
|
|
|
+ add_url: '',
|
|
|
+ edit_url: '',
|
|
|
+ del_url: '',
|
|
|
+ multi_url: '',
|
|
|
+ table: 'fee',
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var table = $("#table");
|
|
|
+
|
|
|
+ // 初始化表格
|
|
|
+ table.bootstrapTable({
|
|
|
+ url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
+ pk: 'user_id',
|
|
|
+ sortName: 'user.user_reg_time',
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ {checkbox: true},
|
|
|
+ {field: 'user_id', title: __('User_id'), sortable: true, operate:false},
|
|
|
+ {field: 'user_nickname', title: __('User_nickname'), operate: 'LIKE'},
|
|
|
+
|
|
|
+ {field: 'abcClass', title: '操作', events:actionEvents, formatter: getAbcClass},
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ commonSearch: false,
|
|
|
+ pagination: false,
|
|
|
+ showToggle: false,
|
|
|
+ showColumns: false,
|
|
|
+ showExport: false,
|
|
|
+ });
|
|
|
+
|
|
|
+ // 移动
|
|
|
+ $(document).on('click', '.btn-fee', function () {
|
|
|
+ var ids = Table.api.selectedids(table);
|
|
|
+ var _params = {
|
|
|
+ id: ids.join(','),
|
|
|
+ fee_id: $('#fee').val(),
|
|
|
+ };
|
|
|
+ $.ajax({
|
|
|
+ dataType: 'json',
|
|
|
+ type: 'POST',
|
|
|
+ url: 'user/user/feeedit',
|
|
|
+ data: _params,
|
|
|
+ success: function (ret) {
|
|
|
+ alert(ret.msg);
|
|
|
+ window.location.reload();
|
|
|
},
|
|
|
error: function (e) {
|
|
|
}
|
|
|
@@ -458,10 +589,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Table.api.bindevent(table);
|
|
|
},
|
|
|
notice: function () {
|
|
|
+ let userList = [];
|
|
|
+ window.actionEvents = {
|
|
|
+ 'click .btn-user':function(e,value,row,index){
|
|
|
+ if($('#user_id'+row.user_id).is(':checked')) {
|
|
|
+ userList.push(row.user_id);
|
|
|
+ }else {
|
|
|
+ let index = userList.indexOf(row.user_id);
|
|
|
+ userList.splice(index, 1);
|
|
|
+ }
|
|
|
+ //console.log(userList);
|
|
|
+ },
|
|
|
+ }
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
- index_url: 'user/user/mail?mail_id=' + $('#mail_id').val(),
|
|
|
+ index_url: 'user/user/mail',
|
|
|
add_url: '',
|
|
|
edit_url: '',
|
|
|
del_url: '',
|
|
|
@@ -480,7 +623,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
pageSize: 30,
|
|
|
columns: [
|
|
|
[
|
|
|
- {checkbox: true},
|
|
|
+ {field: 'check', title: '选择', operate: false, events:actionEvents, formatter: function (value, row, index) {
|
|
|
+ if (userList.indexOf(row.user_id) == -1) {
|
|
|
+ return '<input name="user_id" class="btn-user" id="user_id'+row.user_id+'" value="'+row.user_id+'" type="checkbox" />';
|
|
|
+ } else {
|
|
|
+ return '<input name="user_id" class="btn-user" id="user_id'+row.user_id+'" value="'+row.user_id+'" type="checkbox" checked />';
|
|
|
+ }
|
|
|
+
|
|
|
+ }},
|
|
|
{field: 'user_id', title: __('User_id'), sortable: true, operate:false},
|
|
|
{field: 'user_nickname', title: __('User_nickname'), operate: 'LIKE'},
|
|
|
]
|
|
|
@@ -492,25 +642,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
showExport: false,
|
|
|
});
|
|
|
// 选择范围
|
|
|
- $(document).on('change', '#type', function () {
|
|
|
- var type = $('#type').val();
|
|
|
- if (type==1) {
|
|
|
- $('.btn-send').addClass('btn-disabled');
|
|
|
- } else {
|
|
|
- $('.btn-send').removeClass('btn-disabled');
|
|
|
- }
|
|
|
- });
|
|
|
+ // $(document).on('change', '#type', function () {
|
|
|
+ // var type = $('#type').val();
|
|
|
+ // if (type==1) {
|
|
|
+ // $('.btn-send').addClass('btn-disabled');
|
|
|
+ // } else {
|
|
|
+ // $('.btn-send').removeClass('btn-disabled');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
// 发送
|
|
|
$(document).on('click', '.btn-send', function () {
|
|
|
- var ids = Table.api.selectedids(table);
|
|
|
+ //var ids = Table.api.selectedids(table);
|
|
|
var type = $('#type').val();
|
|
|
- if (type == 1 && ids=='') {
|
|
|
+ if (type == 1 && userList==[]) {
|
|
|
alert(__('Error_info1'));
|
|
|
return;
|
|
|
}
|
|
|
var _params = {
|
|
|
//id: ids.join(','),
|
|
|
- id: ids,
|
|
|
+ id: userList,
|
|
|
notice_id: $('#notice_id').val(),
|
|
|
type: type,
|
|
|
};
|
|
|
@@ -531,6 +681,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Table.api.bindevent(table);
|
|
|
},
|
|
|
mail: function () {
|
|
|
+ let userList = [];
|
|
|
+ window.actionEvents = {
|
|
|
+ 'click .btn-user':function(e,value,row,index){
|
|
|
+ if($('#user_id'+row.user_id).is(':checked')) {
|
|
|
+ userList.push(row.user_id);
|
|
|
+ }else {
|
|
|
+ let index = userList.indexOf(row.user_id);
|
|
|
+ userList.splice(index, 1);
|
|
|
+ }
|
|
|
+ //console.log(userList);
|
|
|
+ },
|
|
|
+ }
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
@@ -553,7 +715,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
pageSize: 30,
|
|
|
columns: [
|
|
|
[
|
|
|
- {checkbox: true},
|
|
|
+ {field: 'check', title: '选择', operate: false, events:actionEvents, formatter: function (value, row, index) {
|
|
|
+ if (userList.indexOf(row.user_id) == -1) {
|
|
|
+ return '<input name="user_id" class="btn-user" id="user_id'+row.user_id+'" value="'+row.user_id+'" type="checkbox" />';
|
|
|
+ } else {
|
|
|
+ return '<input name="user_id" class="btn-user" id="user_id'+row.user_id+'" value="'+row.user_id+'" type="checkbox" checked />';
|
|
|
+ }
|
|
|
+
|
|
|
+ }},
|
|
|
{field: 'user_id', title: __('User_id'), sortable: true, operate:false},
|
|
|
{field: 'user_nickname', title: __('User_nickname'), operate: 'LIKE'},
|
|
|
]
|
|
|
@@ -567,10 +736,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
|
// 发送
|
|
|
$(document).on('click', '.btn-mail', function () {
|
|
|
- var ids = Table.api.selectedids(table);
|
|
|
+ //var ids = Table.api.selectedids(table);
|
|
|
var _params = {
|
|
|
//id: ids.join(','),
|
|
|
- id: ids,
|
|
|
+ id: userList,
|
|
|
mail_id: $('#mail_id').val(),
|
|
|
};
|
|
|
$.ajax({
|
|
|
@@ -598,7 +767,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
edit_url: '',
|
|
|
del_url: '',
|
|
|
multi_url: '',
|
|
|
- table: 'mail',
|
|
|
+ table: 'noticeuser',
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -639,4 +808,4 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
}
|
|
|
};
|
|
|
return Controller;
|
|
|
-});
|
|
|
+});
|