123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace app\admin;
- class user_cash extends Base
- {
- public function initialize()
- {
- parent::initialize();
- $this->Administrator(6);
- $this->header();
- }
- public function __destruct()
- {
- $this->footer();
- }
- function change_status()
- {
- $_var_0 = SafeRequest("id", "get");
- $_var_1 = SafeRequest("status", "get");
- try {
- $_var_2 = db("user_cash")->where("id", $_var_0)->find();
- $_var_3 = db("user")->where("in_userid", $_var_2["user_id"])->find();
- $_var_4 = db("user_cash")->where("id", $_var_0)->update(["status" => $_var_1]);
- $_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", "取消提现返还"));
- $_var_4 = $_var_4 && db("user")->where("in_userid", $_var_2["user_id"])->inc("promote_money", $_var_2["money"])->update();
- $_var_4 = $_var_4 && db("user_cash")->where("id", $_var_0)->update(["status" => 2]);
- } catch (\think\db\exception\DataNotFoundException $_var_5) {
- } catch (\think\db\exception\ModelNotFoundException $_var_5) {
- } catch (\think\db\exception\DbException $_var_5) {
- } catch (\think\exception\DbException $_var_5) {
- }
- }
- function index($map = [])
- {
- $_var_6 = SafeRequest("p", "get");
- if ($_var_6 && $_var_6 == "change_status") {
- change_status();
- }
- $this->type = SafeRequest("type", "get");
- $this->type && ($map[] = ["type", "=", $this->type]);
- $this->IN_CASH_TYPE = ["全部类型", "银行卡", "支付宝"];
- $_var_7 = SafeRequest("page", "get");
- $_var_8 = SafeRequest("user_id", "get");
- $_var_8 && ($map[] = ["user_id", "=", $_var_8]);
- $this->search = SafeRequest("search", "get");
- $this->search && ($map[] = ["u.in_username|note", "like", "%" . $this->search . "%"]);
- $this->mapTime("create_time", true, $map);
- $_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]);
- $_var_10 = $_var_9->items();
- $_var_11 = $_var_9->total();
- $_var_12 = getRender($_var_9, $_var_7);
- ?><div class="container"><?php
- $this->nav3();
- $this->searchForm("可以输入用户名、描述等关键词进行搜索", "", function () {
- ?> <select name="type" onchange="document.btnsearch.submit();">
- <?php
- foreach ($this->IN_CASH_TYPE as $_var_13 => $_var_14) {
- ?> <option value="<?php echo $_var_13;?>" <?php echo is_numeric($this->type) && $this->type == $_var_13 ? "selected=\"selected\"" : "";?>>
- <?php echo $_var_14;?> </option>
- <?php
- }
- ?> </select>
- <?php
- });
- ?>
- <table class="layui-table">
- <thead>
- <tr>
- <th>ID</th>
- <th>用户</th>
- <th>姓名</th>
- <th>账号</th>
- <th>提现金额</th>
- <th>提现方式</th>
- <th>备注</th>
- <th>时间</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <?php
- if ($_var_11 == 0) {
- ?><tr><td colspan="22" style="margin:auto;text-align:center" >暂无数据</td></tr><?php
- }
- if ($_var_10) {
- foreach ($_var_10 as $_var_15) {
- ?><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>
- <td><?php
- if ($_var_15["status"] == 0) {
- ?><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
- } else {
- if ($_var_15["status"] == 1) {
- ?><a href="?c=user_cash&a=index&p=change_status&id=<?php echo $_var_15["id"];?>&status=3" class="act">打款</a><?php
- }
- }
- ?></td></tr><?php
- }
- }
- ?></table>
- <?php echo $this->render($_var_12);?>
- </div>
- <?php
- }
- }
|