数据无法分页

提问 未结 15 347
jsjtzc
jsjtzc VIP4 2019-9-17
悬赏:20飞吻
版本:layui 后台专业版 浏览器:
<script>
layui.use(['laydate', 'form', 'table'], function () {
var table = layui.table;
var form = layui.form;
var laydate = layui.laydate;
var $ = layui.$;
var tonk = $("input[name='__RequestVerificationToken']").val();

laydate.render({
elem: '#test5',
type: 'datetime'
});
laydate.render({
elem: '#test6',
type: 'datetime'
});
table.render({
elem: '#test'
, url: '@Url.Content("~/Business/")'
, count:30
, where: { __RequestVerificationToken: tonk }
, method: 'post'
, cellMinWidth: 60
, cols: [[
{ field: 'id', title: '单号', align: 'center', sort: true }
,{ field: 'user_id', title: '用户ID', align: 'center', sort: true }
, { field: 'methods', title: '方式', align: 'center' }
, { field: 'cash', title: '金额', align: 'center' }
, { field: 'reward', title: '奖励', align: 'center', sort: true, width: 200 }
, { field: 'bank', title: '银行', align: 'center', sort: true }
, { field: 'bank_no', title: '银行账号', align: 'center', sort: true, width: 80 }
, { field: 'bank_user', title: '开户名称', align: 'center', sort: true }
, { field: 'channel', title: '支付类型', align: 'center' }
, { field: 'caship', title: '登录IP', align: 'center', width: 90 }
, { field: 'cashtime', title: '提交时间', align: 'center', sort: true, width: 200 }
, { field: 'checktime', title: '审核时间', align: 'center', width: 90 }
, { field: 'setstart', title: '通知状态', align: 'center' }
]], page: true
, limit: 10
, id: 'testReload'
})
var active = {
reload: function () {
table.reload('testReload', {
where: {
merchant_no: $("input[name='merchant_no']").val(),
order_no: $("input[name='order_no']").val(),
start_time: $("input[name='start_time']").val(),
end_time: $("input[name='end_time']").val()
}
});
}
};
form.render();

$("#fuck-btn").on(click,function () {
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
$("#reloadtable").on(click,function () {
active.reload();
});
$("#reloadpage").on(click,function () {
location.reload();
});
})
</script>
回帖
  • 后台数据接口返回的数据看看
    0 回复
  • 0 回复
  • [System.Web.Mvc.HttpPost]
    [ValidateAntiForgeryToken]
    public string rechargeLog([FromBody]string value = null)
    {
    string json2 = "";
    DataTable rd = new DataTable();
    Base.CapitalLog json = new Base.CapitalLog();
    if (value == null)
    {
    rd = Blluserbase.APISelectDatarechargeLogAll("CapitalLog");
    }
    else
    {
    rd = Blluserbase.APISelectDatarechargeLogAll("CapitalLog", value);
    }
    if (rd != null && rd.Rows.Count > 0)
    {
    Base.CapitalLog._data jsondata = new Base.CapitalLog._data();
    json.data = new System.Collections.Generic.List<Base.CapitalLog._data>();
    foreach (DataRow ro in rd.Rows)
    {
    jsondata.id = ro["id"].ToString();
    jsondata.user_id = ro["user_id"].ToString();
    switch (ro["methods"].ToString())
    {
    case "1": jsondata.methods = "充值"; break;
    case "0": jsondata.methods = "提现"; break;

    }
    jsondata.cash = Convert.ToDecimal(ro["cash"]);
    jsondata.reward = Convert.ToDecimal(ro["reward"]);
    jsondata.bank = ro["bank"].ToString();
    jsondata.bank_no = ro["bank_no"].ToString();
    jsondata.bank_user = ro["bank_user"].ToString();

    switch (ro["channel"].ToString())
    {
    case "0": jsondata.channel = "微信"; break;
    case "1": jsondata.channel = "支付宝"; break;
    case "2": jsondata.channel = "银行"; break;
    }
    jsondata.caship = ro["caship"].ToString();
    jsondata.cashtime = ro["cashtime"].ToString();
    jsondata.checktime = ro["checktime"].ToString();

    switch (ro["setstart"].ToString())
    {
    case "0": jsondata.setstart = "未读"; break;
    case "1": jsondata.setstart = "已读"; break;
    case "2": jsondata.setstart = "审核通过"; break;
    case "3": jsondata.setstart = "已删除"; break;
    }
    json.data.Add(jsondata);
    jsondata = new Base.CapitalLog._data();


    }
    json.code = 0;
    json.msg = "";
    json.count = rd.Rows.Count;
    json2 = JsonConvert.SerializeObject(json, Formatting.Indented);

    }
    return json2;

    }
    0 回复
  • {
    "code": 0,
    "msg": "",
    "count": 30,
    "data": [
    {
    "id": "40125 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40124 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40123 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40122 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40121 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40120 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40119 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40118 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40117 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40116 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40115 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40114 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40113 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40112 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40111 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40110 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40109 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40108 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40107 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40106 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40105 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40104 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40103 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40102 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40101 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40100 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40099 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40098 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40097 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    },
    {
    "id": "40096 ",
    "user_id": "273 ",
    "methods": "提现",
    "cash": 273.00,
    "reward": 0.0,
    "bank": "中国银行 ",
    "bank_no": "8888888888 ",
    "bank_user": "轻轻 ",
    "channel": "支付宝",
    "caship": "127.0.0.1 ",
    "cashtime": "2019/9/16 3:13:51",
    "checktime": "2019/9/16 0:00:00",
    "setstart": "未读"
    }
    ]
    }
    0 回复
  • TaurusGem
    2019-9-17
    数据全部取出来了吧!!mysql没处理分页吧!
    0 回复
  • TRUE149
    2019-9-17
    [亲亲]
    0 回复
  • TRUE149
    2019-9-17
    csacsdsvsdv
    0 回复
  • 这个插件的自动分页是什么意思,运行的原理是什么?
    0 回复
  • 我就给出了30条记录
    0 回复
  • table.render({
    elem: '#test'
    , url: '@Url.Content("~/Business/cashLog")' 我的数据请求是固定的,要手动配置 点击分页按钮的POST吗?
    0 回复