user_cash.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. namespace app\admin;
  3. class user_cash extends Base
  4. {
  5. public function initialize()
  6. {
  7. parent::initialize();
  8. $this->Administrator(6);
  9. $this->header();
  10. }
  11. public function __destruct()
  12. {
  13. $this->footer();
  14. }
  15. function change_status()
  16. {
  17. $_var_0 = SafeRequest("id", "get");
  18. $_var_1 = SafeRequest("status", "get");
  19. try {
  20. $_var_2 = db("user_cash")->where("id", $_var_0)->find();
  21. $_var_3 = db("user")->where("in_userid", $_var_2["user_id"])->find();
  22. $_var_4 = db("user_cash")->where("id", $_var_0)->update(["status" => $_var_1]);
  23. $_var_4 = $_var_4 && $_var_1 == 2 && ($_var_4 = aclog_save($_var_2["user_id"], $_var_3["promote_money"] + $_var_2["money"], $_var_3["promote_money"], "promote_money", "取消提现返还"));
  24. $_var_4 = $_var_4 && db("user")->where("in_userid", $_var_2["user_id"])->inc("promote_money", $_var_2["money"])->update();
  25. $_var_4 = $_var_4 && db("user_cash")->where("id", $_var_0)->update(["status" => 2]);
  26. } catch (\think\db\exception\DataNotFoundException $_var_5) {
  27. } catch (\think\db\exception\ModelNotFoundException $_var_5) {
  28. } catch (\think\db\exception\DbException $_var_5) {
  29. } catch (\think\exception\DbException $_var_5) {
  30. }
  31. }
  32. function index($map = [])
  33. {
  34. $_var_6 = SafeRequest("p", "get");
  35. if ($_var_6 && $_var_6 == "change_status") {
  36. change_status();
  37. }
  38. $this->type = SafeRequest("type", "get");
  39. $this->type && ($map[] = ["type", "=", $this->type]);
  40. $this->IN_CASH_TYPE = ["全部类型", "银行卡", "支付宝"];
  41. $_var_7 = SafeRequest("page", "get");
  42. $_var_8 = SafeRequest("user_id", "get");
  43. $_var_8 && ($map[] = ["user_id", "=", $_var_8]);
  44. $this->search = SafeRequest("search", "get");
  45. $this->search && ($map[] = ["u.in_username|note", "like", "%" . $this->search . "%"]);
  46. $this->mapTime("create_time", true, $map);
  47. $_var_9 = db("user_cash")->alias("ua")->join("user u", "u.in_userid=ua.user_id")->field("ua.*,u.in_username")->where($map)->order("id desc")->paginate(["page" => $_var_7]);
  48. $_var_10 = $_var_9->items();
  49. $_var_11 = $_var_9->total();
  50. $_var_12 = getRender($_var_9, $_var_7);
  51. ?><div class="container"><?php
  52. $this->nav3();
  53. $this->searchForm("可以输入用户名、描述等关键词进行搜索", "", function () {
  54. ?> <select name="type" onchange="document.btnsearch.submit();">
  55. <?php
  56. foreach ($this->IN_CASH_TYPE as $_var_13 => $_var_14) {
  57. ?> <option value="<?php echo $_var_13;?>" <?php echo is_numeric($this->type) && $this->type == $_var_13 ? "selected=\"selected\"" : "";?>>
  58. <?php echo $_var_14;?> </option>
  59. <?php
  60. }
  61. ?> </select>
  62. <?php
  63. });
  64. ?>
  65. <table class="layui-table">
  66. <thead>
  67. <tr>
  68. <th>ID</th>
  69. <th>用户</th>
  70. <th>姓名</th>
  71. <th>账号</th>
  72. <th>提现金额</th>
  73. <th>提现方式</th>
  74. <th>备注</th>
  75. <th>时间</th>
  76. <th>状态</th>
  77. <th>操作</th>
  78. </tr>
  79. </thead>
  80. <?php
  81. if ($_var_11 == 0) {
  82. ?><tr><td colspan="22" style="margin:auto;text-align:center" >暂无数据</td></tr><?php
  83. }
  84. if ($_var_10) {
  85. foreach ($_var_10 as $_var_15) {
  86. ?><tr><td><?php echo $_var_15["id"];?></td><td><a href="?c=user_cash&a=index&user_id=<?php echo $_var_15["user_id"];?>"><?php echo $_var_15["in_username"];?></a></td><td><?php echo $_var_15["name"];?></td><td><?php echo $_var_15["account"];?></td><td><?php echo $_var_15["money"];?></td><td><a href="?c=user_cash&a=index&type=<?php echo $_var_15["type"];?>"><?php echo ["", "银行卡", "支付宝"][$_var_15["type"]];?></a></td><td><?php echo $_var_15["note"];?></td><td><?php echo date("Y-m-d H:i:s", $_var_15["create_time"]);?></td><td><?php echo ["申请中", "已受理", "已取消", "已打款"][$_var_15["status"]];?></td>
  87. <td><?php
  88. if ($_var_15["status"] == 0) {
  89. ?><a href="?c=user_cash&a=index&p=change_status&id=<?php echo $_var_15["id"];?>&status=1" class="act">受理</a><a href="?c=user_cash&a=index&p=change_status&id=<?php echo $_var_15["id"];?>&status=2" class="act">取消</a><?php
  90. } else {
  91. if ($_var_15["status"] == 1) {
  92. ?><a href="?c=user_cash&a=index&p=change_status&id=<?php echo $_var_15["id"];?>&status=3" class="act">打款</a><?php
  93. }
  94. }
  95. ?></td></tr><?php
  96. }
  97. }
  98. ?></table>
  99. <?php echo $this->render($_var_12);?>
  100. </div>
  101. <?php
  102. }
  103. }