Browse Source

'充值管理'

Ethan 6 years ago
parent
commit
0bb240f77b
30 changed files with 956 additions and 67 deletions
  1. 64 22
      application/admin/controller/AdminControl.php
  2. 112 12
      application/admin/controller/Recharge.php
  3. 36 0
      application/admin/controller/Server.php
  4. 60 0
      application/admin/controller/User.php
  5. 18 0
      application/admin/model/CapitalMovements.php
  6. 25 0
      application/admin/model/Product.php
  7. 30 3
      application/admin/model/Recharge.php
  8. 18 0
      application/admin/model/UserMessage.php
  9. 27 0
      application/admin/model/Userinfo.php
  10. 7 5
      application/admin/view/index/index.html
  11. 149 0
      application/admin/view/recharge/examine.html
  12. 3 3
      application/admin/view/recharge/index.html
  13. 87 0
      application/admin/view/server/index.html
  14. 86 2
      application/admin/view/user/index.html
  15. 8 3
      application/common/model/User.php
  16. 19 3
      application/home/controller/Product.php
  17. 18 0
      application/home/model/CapitalMovements.php
  18. 32 0
      application/user/controller/Cost.php
  19. 17 0
      application/user/controller/Renewal.php
  20. 5 1
      application/user/controller/UserControl.php
  21. 24 0
      application/user/model/CapitalMovements.php
  22. 1 0
      application/user/model/Order.php
  23. 1 1
      application/user/model/Recharge.php
  24. 1 0
      application/user/model/Userproduct.php
  25. 85 0
      application/user/view/cost/capital.html
  26. 3 3
      application/user/view/cost/orderManagement.html
  27. 14 5
      application/user/view/cost/transaction.html
  28. 2 1
      application/user/view/index/index.html
  29. 1 1
      application/user/view/message/index.html
  30. 3 2
      application/user/view/renewal/index.html

+ 64 - 22
application/admin/controller/AdminControl.php

@@ -125,7 +125,7 @@ class AdminControl extends Controller
                         'text' => lang('ds_welcome'), 'url' => url('Wlcome/index'),
                     ),
                     'homeInfo' => array(
-                        'text' => '页信息', 'url' => url('Homeinfo/index'),
+                        'text' => '页信息管理', 'url' => url('Homeinfo/index'),
                     ),
                 ),
             ),
@@ -162,25 +162,25 @@ class AdminControl extends Controller
 					),
 				),
             ),
-//            'personnel_manage' => array(
-//                'name' => 'personnel_manage',
-//                'text' => lang('ds_personnel_manage'),
-//                'children' => array(
-//                    'member' => array(
-//                        'text' => lang('ds_member'),
-//                        'url' => url('User/index'),
-//                    ),
-//                    'admin' => array(
-//                        'text' => lang('ds_admin'),
-//                        'url' => url('Recharge/index'),
-//                    ),
-//                    'admingroup' => array(
-//                        'text' => lang('ds_admin_group'),
-//                        'url' => url('Admingroup/index'),
-//                    ),
-//                ),
-//            ),
             'personnel_manage' => array(
+                'name' => 'personnel_manage',
+                'text' => '管理员管理',
+                'children' => array(
+                    'member' => array(
+                        'text' => lang('ds_member'),
+                        'url' => url('User/index'),
+                    ),
+                    'admin' => array(
+                        'text' => lang('ds_admin'),
+                        'url' => url('Recharge/index'),
+                    ),
+                    'admingroup' => array(
+                        'text' => lang('ds_admin_group'),
+                        'url' => url('Admingroup/index'),
+                    ),
+                ),
+            ),
+            'user' => array(
                 'name' => 'personnel_manage',
                 'text' => lang('ds_personnel_manage'),
                 'children' => array(
@@ -188,13 +188,55 @@ class AdminControl extends Controller
                         'text' => lang('ds_user_list'),
                         'url' => url('User/index'),
                     ),
+                    'admingroup' => array(
+                        'text' => lang('ds_certification_list'),
+                        'url' => url('Admingroup/index'),
+                    ),
+                ),
+            ),
+            'redenvelope' => array(
+                'name' => 'recharge_manage',
+                'text' => '充值管理',
+                'children' => array(
                     'recharge' => array(
                         'text' => lang('ds_user_recharge_list'),
                         'url' => url('Recharge/index'),
                     ),
-                    'admingroup' => array(
-                        'text' => lang('ds_certification_list'),
-                        'url' => url('Admingroup/index'),
+                    'examine' => array(
+                        'text' => '充值审核',
+                        'url' => url('Recharge/examine'),
+                    ),
+                ),
+            ),
+            'shopping' => array(
+                'name' => 'recharge_manage',
+                'text' => '订单管理',
+                'children' => array(
+                    'recharge' => array(
+                        'text' => lang('ds_user_recharge_list'),
+                        'url' => url('Recharge/index'),
+                    ),
+                    'examine' => array(
+                        'text' => '充值审核',
+                        'url' => url('Recharge/examine'),
+                    ),
+                ),
+            ),
+            'detail' => array(
+                'name' => 'server_manage',
+                'text' => '服务管理',
+                'children' => array(
+                    'list' => array(
+                        'text' => '服务列表',
+                        'url' => url('Server/index'),
+                    ),
+                    'term' => array(
+                        'text' => '服务购买期限',
+                        'url' => url('Recharge/examine'),
+                    ),
+                    'serverUser' => array(
+                        'text' => '用户服务列表',
+                        'url' => url('Recharge/examine'),
                     ),
                 ),
             ),

+ 112 - 12
application/admin/controller/Recharge.php

@@ -23,7 +23,6 @@ class Recharge extends AdminControl
         $model_recharge = Model('Recharge');
         $title = input('post.title');
         $time = input('post.timeRang');
-        echo $time;
         if(!empty($time)){
             $gap = explode(' - ', $time);
             $begin = $gap[0];
@@ -37,22 +36,25 @@ class Recharge extends AdminControl
             $condition['recharge_time'] = array('between', array($begin, $end));
         }
         $recharge_list = $model_recharge->getRechargeList($condition, '*', 10);
-        for($i=0;$i<count($recharge_list);$i++){
-            if($recharge_list[$i]['recharge_type'] == 1){
-                $recharge_list[$i]['recharge_type'] = '支付宝';
+        foreach ($recharge_list as $key => $value) {
+            if($value['recharge_type'] == 1){
+                $recharge_list[$key]['recharge_type'] = '支付宝';
             }
-            if($recharge_list[$i]['recharge_type'] == 2){
-                $recharge_list[$i]['recharge_type'] = '微信';
+            if($value['recharge_type'] == 2){
+                $recharge_list[$key]['recharge_type'] = '微信';
             }
-            if($recharge_list[$i]['recharge_type'] == 3){
-                $recharge_list[$i]['recharge_type'] = '银行卡';
+            if($value['recharge_type'] == 3){
+                $recharge_list[$key]['recharge_type'] = '银行卡';
             }
 
-            if($recharge_list[$i]['recharge_status'] == 1){
-                $recharge_list[$i]['recharge_status'] = '已审核';
+            if($value['recharge_status'] == 1){
+                $recharge_list[$key]['recharge_status'] = '已审核';
             }
-            if($recharge_list[$i]['recharge_status'] == 2){
-                $recharge_list[$i]['recharge_status'] = '未审核';
+            if($value['recharge_status'] == 2){
+                $recharge_list[$key]['recharge_status'] = '未审核';
+            }
+            if($value['recharge_status'] === 0){
+                $recharge_list[$key]['recharge_status'] = '无效';
             }
         }
         $allpower = $this->qxhans();
@@ -62,5 +64,103 @@ class Recharge extends AdminControl
         $this->setAdminCurItem('index');
         return $this->fetch();
     }
+    public function examine()
+    {
+        $model_recharge = Model('Recharge');
+        $recharge_list = $model_recharge->rechargeList(['recharge_status'=>2]);
+        $this->assign('recharge_list', $recharge_list);
+        $this->assign('show_page',  $recharge_list->render());
+        return $this->fetch();
+    }
+    public function putExamine()
+    {
+        $money = input('post.money');
+        $recharge_id = input('post.recharge_id');
+        if ($money && $recharge_id) {
+            $model_recharge = Model('Recharge');
+            $userInfo = Model('userinfo');
+            $userMessage = Model('userMessage');
+            $capitalMovements = Model('CapitalMovements');
+            $recharge = $model_recharge->findRecharge(['recharge_id'=>$recharge_id]);
+            if ($recharge->recharge_status != 2) {
+                return ["msg" => "错误:该记录已审核"];
+            }
+            $model_recharge->startTrans();
+            $userInfo->startTrans();
+            $userMessage->startTrans();
+            $capitalMovements->startTrans();
+            try {
+                $balance = $recharge->userInfo_money + $money;
+                $model_recharge->updateRecharge(['recharge_id'=>$recharge_id], ['recharge_money'=>$money,'user_money'=>$balance,'recharge_status'=>1]);
+                $userInfo->updateUserInfo(['user_id'=>$recharge->user_id], ['userInfo_money'=>$balance]);
+                $nowDate = date('Y-m-d H:i:s');
+                $userMessageData = [
+                    'user_id' => $recharge->user_id,
+                    'userMessage_title' => '充值消息',
+                    'userMessage_content' => '您的充值订单号:' . $recharge->recharge_identity . '经管理员审核通过。',
+                    'userMessage_create' => $nowDate,
+                    'userMessage_update' => $nowDate,
+                ];
+                $userMessage->addMessage($userMessageData);
+                if ($recharge->type == 1) {
+                    $type = '支付宝充值';
+                } else if ($recharge->type == 2) {
+                    $type = '微信充值';
+                } else {
+                    $type = '银行卡转账';
+                }
+                $cplMvtData = [
+                    'user_id' => $recharge->user_id,
+                    'capitalMovements_describe' => $type,
+                    'capitalMovements_identity' => $recharge->recharge_identity,
+                    'capitalMovements_create' => $nowDate,
+                    'capitalMovements_update' => $nowDate,
+                    'capitalMovements_money' => $money,
+                    'capitalMovements_type' => 1,
+                    'capitalMovements_cash' => $balance,
+                    'capitalMovements_operator' => $recharge->user_id,
+                ];
+                $capitalMovements->add($cplMvtData);
+                $model_recharge->commit();
+                $userInfo->commit();
+                $userMessage->commit();
+                $capitalMovements->commit();
+                return ["msg" => "审核成功"];
+            } catch (\Exception $e) {
+                // 回滚事务
+                $model_recharge->rollBack();
+                $userInfo->rollBack();
+                $userMessage->rollBack();
+                $capitalMovements->rollBack();
+                return ["msg" => "操作失败"];
+            }
+        } else if($recharge_id) {
+            $model_recharge = Model('Recharge');
+            $userMessage = Model('userMessage');
+            try {
+                $recharge = $model_recharge->findRecharge(['recharge_id'=>$recharge_id]);
+                $model_recharge->updateRecharge(['recharge_id'=>$recharge_id], ['recharge_status'=>0]);
+                $nowDate = date('Y-m-d H:i:s');
+                $userMessageData = [
+                    'user_id' => $recharge->user_id,
+                    'userMessage_title' => '充值消息',
+                    'userMessage_content' => '您的充值订单号:' . $recharge->recharge_identity . '管理员审核为无效订单,如有疑问请联系客服。',
+                    'userMessage_create' => $nowDate,
+                    'userMessage_update' => $nowDate,
+                ];
+                $userMessage->addMessage($userMessageData);
+                $model_recharge->commit();
+                $userMessage->commit();
+                return ["msg" => "作废成功"];
+            } catch (\Exception $e) {
+                // 回滚事务
+                $model_recharge->rollBack();
+                $userMessage->rollBack();
+                return ["msg" => "操作失败"];
+            }
+        } else {
+            return ["msg" => "错误:请正确填写充值金额"];
+        }
+    }
 
 }

+ 36 - 0
application/admin/controller/Server.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace app\admin\controller;
+
+use think\Validate;
+use think\Lang;
+
+class Server extends AdminControl
+{
+
+    public function _initialize()
+    {
+        parent::_initialize();
+        Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/member.lang.php');
+    }
+
+    /**
+     * 充值列表
+     * @return mixed
+     */
+    public function index()
+    {
+        $productModel = Model('Product');
+        $fartherProduct = $productModel->getFartherList();
+        $this->assign('fartherProduct',  $fartherProduct);
+        $fartherId = input('get.fartherId') ?? $fartherProduct[0]->product_id;
+        $this->assign('id',  $fartherId);
+        $sonProductWhere['product_pid'] = $fartherId;
+        $sonProduct = $productModel->getSonList($sonProductWhere);
+        $this->assign('sonProduct',  $sonProduct);
+        $this->assign('show_page',  $sonProduct->render());
+
+        return $this->fetch();
+    }
+
+}

+ 60 - 0
application/admin/controller/User.php

@@ -63,5 +63,65 @@ class User extends AdminControl
         $this->setAdminCurItem('index');
         return $this->fetch();
     }
+    public function recharge()
+    {
+        $money = input('post.money');
+        $user_id = input('post.user_id');
+        $type = input('post.type');
+        if ($money && $user_id) {
+            $userInfo = Model('userinfo');
+            $userMessage = Model('userMessage');
+            $capitalMovements = Model('CapitalMovements');
+            $getUserInfo = $userInfo->getUserInfo(['user_id'=>$user_id]);
+            $userInfo->startTrans();
+            $userMessage->startTrans();
+            $capitalMovements->startTrans();
+            try {
+                if ($type == 1) {
+                    $balance = $getUserInfo->userInfo_money + $money;
+                    $msg = '充值';
+                } else {
+                    $balance = $getUserInfo->userInfo_money - $money;
+                    $msg = '扣款';
+                }
+                $userInfo->updateUserInfo(['user_id'=>$user_id], ['userInfo_money'=>$balance]);
+                $nowDate = date('Y-m-d H:i:s');
+                $userMessageData = [
+                    'user_id' => $user_id,
+                    'userMessage_title' => '充值消息',
+                    'userMessage_content' => '后台管理员' . $msg . $money . '元',
+                    'userMessage_create' => $nowDate,
+                    'userMessage_update' => $nowDate,
+                ];
+                $userMessage->addMessage($userMessageData);
+                $orderID = OrderID();
+                $admin = session('admin_id');
+                $cplMvtData = [
+                    'user_id' => $user_id,
+                    'capitalMovements_describe' => '后台管理员' . $msg . $money . '元',
+                    'capitalMovements_identity' => $orderID,
+                    'capitalMovements_create' => $nowDate,
+                    'capitalMovements_update' => $nowDate,
+                    'capitalMovements_money' => $money,
+                    'capitalMovements_type' => $type,
+                    'capitalMovements_cash' => $balance,
+                    'capitalMovements_operator' => $admin,
+                ];
+                $capitalMovements->add($cplMvtData);
+                $userInfo->commit();
+                $userMessage->commit();
+                $capitalMovements->commit();
+                return ["msg" => $msg . "成功"];
+            } catch (\Exception $e) {
+                // 回滚事务
+                $userInfo->rollBack();
+                $userMessage->rollBack();
+                $capitalMovements->rollBack();
+                return ["msg" => "操作失败"];
+            }
+        } else {
+            return ["msg" => "错误:请正确填写充值金额"];
+        }
+    }
 
 }

+ 18 - 0
application/admin/model/CapitalMovements.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+class CapitalMovements extends Model
+{
+    public function add($data)
+    {
+        $result = $this
+            ->insert($data);
+
+        return $result;
+    }
+
+
+}

+ 25 - 0
application/admin/model/Product.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+class Product extends Model
+{
+    public function getSonList($condition)
+    {
+        $result = $this
+            ->where($condition)
+            ->paginate(10);
+        return $result;
+    }
+    public function getFartherList()
+    {
+        $result = $this
+            ->where(['product_pid' => 0])
+            ->select();
+        return $result;
+    }
+
+
+}

+ 30 - 3
application/common/model/Recharge.php → application/admin/model/Recharge.php

@@ -1,12 +1,11 @@
 <?php
 
-namespace app\common\model;
+namespace app\admin\model;
 
 use think\Model;
 
 class Recharge extends Model
 {
-    public $page_info;
 
     /**
      * 充值列表
@@ -29,6 +28,34 @@ class Recharge extends Model
         $this->page_info = $user_list;
         return $user_list->items();
     }
+    public function rechargeList($condition)
+    {
+        $user_list = $this
+            ->alias('a')
+            ->join('user b','b.user_id = a.user_id')
+            ->where($condition)
+            ->order('recharge_time desc')
+            ->paginate(10);
+        return $user_list;
+    }
+    public function findRecharge($condition)
+    {
+        $result = $this
+            ->alias('a')
+            ->join('userinfo b','b.user_id = a.user_id')
+            ->where($condition)
+            ->find();
+
+        return $result;
+    }
+    public function updateRecharge($condition, $data)
+    {
+        $result = $this
+            ->where($condition)
+            ->update($data);
+
+        return $result;
+    }
 
 
-}
+}

+ 18 - 0
application/admin/model/UserMessage.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+class UserMessage extends Model
+{
+    public function addMessage($data)
+    {
+        $result = $this
+            ->insert($data);
+
+        return $result;
+    }
+
+
+}

+ 27 - 0
application/admin/model/Userinfo.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+
+class Userinfo extends Model
+{
+    public function updateUserInfo($condition, $data)
+    {
+        $result = $this
+            ->where($condition)
+            ->update($data);
+
+        return $result;
+    }
+    public function getUserInfo($condition)
+    {
+        $result = $this
+            ->where($condition)
+            ->find();
+
+        return $result;
+    }
+
+
+}

+ 7 - 5
application/admin/view/index/index.html

@@ -3,12 +3,14 @@
 <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <title>安全猫官网</title>
+    <title>AQM</title>
     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
+    <link rel="SHORTCUT ICON" href="{$Think.HOME_SITE_ROOT}/images/LOGO.png"/>
     <!-- Bootstrap 3.3.7 -->
     <link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/layui/css/layui.css">
     <link rel="stylesheet" href="{$Think.ADMIN_SITE_ROOT}/css/admin.css">
     <link rel="stylesheet" href="{$Think.ADMIN_SITE_ROOT}/iconfont/iconfont.css">
+    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1245784_bnygl9xu8eq.css">
     <script src="{$Think.PLUGINS_SITE_ROOT}/jquery-2.1.4.min.js"></script>
     <script src="{$Think.ADMIN_SITE_ROOT}/js/admin.js"></script>
     <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/layui/layui.js"></script>
@@ -76,9 +78,9 @@
                 <div class="title" id="navT"><i class="iconfont icon-{$fe_menu}"></i><span class="title-txt"> {$menu.text}</span><span class="layui-nav-more"></span></div>
                 <ul class="treeview-menu" id="navC" style="display:none;">
                     {foreach name="menu.children" item="submenu" key="fe_submenu" }
-                    {if array_intersect(explode("/",substr($submenu['url'],7,-5)),$gupinfo)}
+                    <!--{//if array_intersect(explode("/",substr($submenu['url'],7,-5)),$gupinfo)}-->
                         <li><a data-id="{$fe_menu}-{$fe_submenu}" href="{$submenu.url}" class="admin-nav-item">{$submenu.text}</a></li>
-                    {/if}
+                    <!--{//if}-->
                     {/foreach}
                 </ul>
             </li>
@@ -87,7 +89,7 @@
                     <div class="title" id="navT"><i class="iconfont icon-{$fe_menu}"></i><a data-id="{$fe_menu}" href="{$menu.url}" class="admin-nav-item">{$menu.text}</a></div>
                 </li>
             {/if}
-        
+
             {/foreach}
         </ul>
     </div>
@@ -197,4 +199,4 @@
 </body>
 
 
-</html>
+</html>

+ 149 - 0
application/admin/view/recharge/examine.html

@@ -0,0 +1,149 @@
+{extend name="layout:home" /}
+{block name="container"}
+<div class="layui-tab layui-tab-card">
+    <div class="layui-layer-shade recharge-layui-layer-shade4" id="layui-layer-shade4" times="4" style="display: none;"></div>
+    <div style="display: none;" class="layui-layer layui-layer-dialog recharge-layui-layer2" id="layui-layer3" type="dialog" times="2" showtime="0" contype="string">
+        <div id="layui-layer-content2" class="layui-layer-content"></div>
+        <span class="layui-layer-setwin" onclick="hiddenTips2()"><a class="layui-layer-ico layui-layer-close layui-layer-close2"
+                                                                    href="javascript:;"></a></span>
+        <div class="layui-layer-btn layui-layer-btn-" onclick="hiddenTips2()"><a class="layui-layer-btn0">确定</a></div>
+        <span class="layui-layer-resize"></span>
+    </div>
+    <div style="display: none;" class="layui-layer layui-layer-dialog recharge-layui-layer2" id="layui-layer2" type="dialog" times="2" showtime="0" contype="string">
+        <div class="layui-tab">
+            <div class="layui-tab-content page-tab-content">
+                <div class="layui-tab-item layui-show" style="width: 300px; height: 150px">
+                    <input name="recharge_id" id="recharge_id" style="display: none">
+                    <div class="layui-form-item" id="oajax">
+                        <label class="layui-form-label" style="width: 100px">充值金额:</label>
+                        <div class="layui-input-block">
+                            <input id="money" class="layui-input field-name" name="money" style="width: 120px" />
+                        </div>
+                    </div>
+                    <div class="layui-form-item" style="margin-top: 60px">
+                        <div class="layui-input-block">
+                            <input type="submit" class="layui-btn layui-btn-normal" lay-submit onclick="submit()"
+                                   value="确认"/>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <span class="layui-layer-setwin" onclick="hiddenTips()">
+            <a class="layui-layer-ico layui-layer-close layui-layer-close2" href="javascript:;"></a>
+        </span>
+        <span class="layui-layer-resize"></span>
+    </div>
+    <div class="layui-tab-content page-tab-content">
+        <table class="layui-table lay-even">
+            <colgroup>
+                <col width="150">
+                <col width="200">
+                <col>
+            </colgroup>
+            <thead>
+            <tr>
+                <th>订单号</th>
+                <th>{$Think.lang.user_email}</th>
+                <th>{$Think.lang.recharge_time}</th>
+                <th>{$Think.lang.recharge_type}</th>
+                <th>操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            {if count($recharge_list)}
+                {volist name="recharge_list" id="recharge"}
+                    <tr>
+                        <td>{$recharge.recharge_identity}</td>
+                        <td>{$recharge.user_email}</td>
+                        <td>{$recharge.recharge_time}</td>
+                        <td>{$recharge.recharge_type == 2 ? '微信支付' : ($recharge.recharge_type == 3 ? '银行转账' : '支付宝支付')}</td>
+                        <td>
+                            <a onclick="examine({$recharge.recharge_id})" class="layui-btn layui-btn-xs">审核</a>
+                            <a onclick="toVoid({$recharge.recharge_id})" class="layui-btn layui-btn-xs">作废</a>
+                        </td>
+                    </tr>
+                {/volist}
+            {else}
+            <td colspan="99" style="text-align: center">无数据</td>
+            {/if}
+            </tbody>
+        </table>
+        {$show_page}
+    </div>
+</div>
+<script type="text/javascript">
+    const myHost = "http://" + window.location.host;
+    function examine(recharge_id) {
+        $("#layui-layer2").attr("style","display: block")
+        $("#layui-layer-shade4").attr("style","display: block")
+        $("#recharge_id").val(recharge_id);
+    }
+    function toVoid(recharge_id) {
+        let url = myHost + "/Admin/Recharge/putExamine.html";
+        $.ajax({
+            type: "post",
+            url: url,
+            data: {recharge_id: recharge_id},
+            dataType: "json",
+            success: function (msg) {
+                $("#layui-layer-content2").html(msg['msg'])
+                $("#layui-layer3").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            },
+            error: function () {
+                $("#layui-layer-content2").html("错误:链接不到服务器")
+                $("#layui-layer3").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            }
+        });
+    }
+    function hiddenTips() {
+        $("#layui-layer2").attr("style","display: none")
+        $("#layui-layer-shade4").attr("style","display: none")
+    }
+    function hiddenTips2() {
+        $("#layui-layer3").attr("style","display: none")
+        $("#layui-layer-shade4").attr("style","display: none")
+        window.location.href = myHost + "/Admin/Recharge/examine.html";
+    }
+    function submit() {
+        let url = myHost + "/Admin/Recharge/putExamine.html";
+        let recharge_id = $("#recharge_id").val();
+        let money = $("#money").val();
+        hiddenTips();
+        $.ajax({
+            type: "post",
+            url: url,
+            data: {money: money, recharge_id: recharge_id},
+            dataType: "json",
+            success: function (msg) {
+                $("#layui-layer-content2").html(msg['msg'])
+                $("#layui-layer3").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            },
+            error: function () {
+                $("#layui-layer-content2").html("错误:链接不到服务器")
+                $("#layui-layer3").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            }
+        });
+    }
+    layui.use('laydate', function(){
+      var laydate = layui.laydate;
+
+      //执行一个laydate实例
+      laydate.render({
+        elem: '#creatTime' //指定元素
+      });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{/block}

+ 3 - 3
application/admin/view/recharge/index.html

@@ -38,7 +38,7 @@
             </tr>
             </thead>
             <tbody>
-            {if $recharge_list}
+            {if count($recharge_list)}
             {volist name="recharge_list" id="recharge"}
             <tr>
                 <td>{$recharge.recharge_identity}</td>
@@ -52,7 +52,7 @@
             </tr>
             {/volist}
             {else}
-            <td>无数据</td>
+            <td colspan="99" style="text-align: center">无数据</td>
             {/if}
             </tbody>
         </table>
@@ -77,4 +77,4 @@
         })
     });
 </script>
-{/block}
+{/block}

+ 87 - 0
application/admin/view/server/index.html

@@ -0,0 +1,87 @@
+{extend name="layout:home" /}
+{block name="container"}
+<div class="layui-tab layui-tab-card">
+    <input type="text" style="display: none" name="id" id="id" value="{$id}">
+    <ul class="layui-tab-title">
+        {volist name="fartherProduct" id="value"}
+        <li id="li-{$value.product_id}" onclick="showCurrent({$value.product_id})">
+            <a>{$value.product_name}</a>
+        </li>
+        {/volist}
+    </ul>
+    <div class="layui-tab-content page-tab-content">
+        <table class="layui-table lay-even">
+            <colgroup>
+                <col width="150">
+                <col width="200">
+                <col>
+            </colgroup>
+            <thead>
+            <tr>
+                <th>服务名称</th>
+                <th>服务简介</th>
+                <th>服务报价</th>
+                <th>状态</th>
+                <th>图片</th>
+            </tr>
+            </thead>
+            <tbody>
+            {if count($sonProduct)}
+            {volist name="sonProduct" id="value"}
+            <tr>
+                <td>{$value.product_name}</td>
+                <td><?php echo mb_substr($value->product_content,0,30, 'utf-8');?>...</td>
+                <td>{$value.product_money}</td>
+                <td>{$value.product_status == 1 ? '启用' : '下线'}</td>
+                <td>
+                    {if $value.product_img}
+                    <img src="{$Think.HOME_SITE_ROOT}{$value.product_img}" style="width: 100px;height: 100px">
+                    {/if}
+                </td>
+            </tr>
+            {/volist}
+            {else}
+            <td colspan="99" style="text-align: center">无数据</td>
+            {/if}
+            </tbody>
+        </table>
+        {$show_page}
+    </div>
+</div>
+<script>
+    const myHost = "http://" + window.location.host;
+    let current = $("#id").val();
+    $("#li-" + current).attr("class","layui-this")
+    function showCurrent(id) {
+        if (id) {
+            $("#status").val(id)
+        }
+        let timeRang = $("#timeRang").val();
+        let status = $("#status").val();
+        window.location.href = myHost + "/User/cost/orderManagement.html?timeRang=" + timeRang + "&status=" + status;
+    }
+    function getQueryString(name) {
+        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+        var url=decodeURI(decodeURI(window.location.search))
+        var r = url.substr(1).match(reg);
+        if (r != null) return unescape(r[2]); return null;
+    }
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        //执行一个laydate实例
+        laydate.render({
+            elem: '#creatTime' //指定元素
+        });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{/block}
+

+ 86 - 2
application/admin/view/user/index.html

@@ -1,6 +1,40 @@
 {extend name="layout:home" /}
 {block name="container"}
 <div class="layui-tab layui-tab-card">
+    <div class="layui-layer-shade recharge-layui-layer-shade4" id="layui-layer-shade4" times="4" style="display: none;"></div>
+    <div style="display: none;" class="layui-layer layui-layer-dialog recharge-layui-layer2" id="layui-layer3" type="dialog" times="2" showtime="0" contype="string">
+        <div id="layui-layer-content2" class="layui-layer-content"></div>
+        <span class="layui-layer-setwin" onclick="hiddenTips2()"><a class="layui-layer-ico layui-layer-close layui-layer-close2"
+                                                                    href="javascript:;"></a></span>
+        <div class="layui-layer-btn layui-layer-btn-" onclick="hiddenTips2()"><a class="layui-layer-btn0">确定</a></div>
+        <span class="layui-layer-resize"></span>
+    </div>
+    <div style="display: none;" class="layui-layer layui-layer-dialog recharge-layui-layer2" id="layui-layer2" type="dialog" times="2" showtime="0" contype="string">
+        <div class="layui-tab">
+            <div class="layui-tab-content page-tab-content">
+                <div class="layui-tab-item layui-show" style="width: 300px; height: 150px">
+                    <input name="user_id" id="user_id" style="display: none">
+                    <input name="type" id="type" style="display: none">
+                    <div class="layui-form-item" id="oajax">
+                        <label class="layui-form-label" style="width: 100px" id="moneyLabel"></label>
+                        <div class="layui-input-block">
+                            <input id="money" class="layui-input field-name" name="money" style="width: 120px" />
+                        </div>
+                    </div>
+                    <div class="layui-form-item" style="margin-top: 60px">
+                        <div class="layui-input-block">
+                            <input type="submit" class="layui-btn layui-btn-normal" lay-submit onclick="submit()"
+                                   value="确认"/>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <span class="layui-layer-setwin" onclick="hiddenTips()">
+            <a class="layui-layer-ico layui-layer-close layui-layer-close2" href="javascript:;"></a>
+        </span>
+        <span class="layui-layer-resize"></span>
+    </div>
     {include file="layout/admin_items" /}
     <div class="layui-tab-content page-tab-content">
         <!-- 搜索框开始 -->
@@ -33,6 +67,8 @@
                 <th>{$Think.lang.add_time}</th>
                 <th>{$Think.lang.user_type}</th>
                 <th>{$Think.lang.if_certification}</th>
+                <th>用户余额</th>
+                <th>操作</th>
             </tr>
             </thead>
             <tbody>
@@ -44,7 +80,11 @@
                 <td>{$user.user_addTime}</td>
                 <td>{$user.user_type}</td>
                 <td>{$user.user_status}</td>
-
+                <td>{$user.userInfo_money}</td>
+                <td>
+                    <a onclick="recharge({$user.user_id}, 1)" class="layui-btn layui-btn-xs">充值</a>
+                    <a onclick="recharge({$user.user_id}, 2)" class="layui-btn layui-btn-xs">扣款</a>
+                </td>
             </tr>
             {/volist}
             {else}
@@ -56,6 +96,50 @@
     </div>
 </div>
 <script type="text/javascript">
+    const myHost = "http://" + window.location.host;
+    function recharge(user_id, type) {
+        $("#user_id").val(user_id);
+        $("#type").val(type);
+        if (type == 1) {
+            $("#moneyLabel").html("充值金额");
+        } else {
+            $("#moneyLabel").html("扣款金额");
+        }
+        $("#layui-layer2").attr("style","display: block")
+        $("#layui-layer-shade4").attr("style","display: block")
+    }
+    function hiddenTips() {
+        $("#layui-layer2").attr("style","display: none")
+        $("#layui-layer-shade4").attr("style","display: none")
+    }
+    function hiddenTips2() {
+        $("#layui-layer3").attr("style","display: none")
+        $("#layui-layer-shade4").attr("style","display: none")
+        window.location.href = myHost + "/Admin/user/index.html";
+    }
+    function submit() {
+        let url = myHost + "/Admin/user/recharge.html";
+        let user_id = $("#user_id").val();
+        let money = $("#money").val();
+        let type = $("#type").val();
+        hiddenTips();
+        $.ajax({
+            type: "post",
+            url: url,
+            data: {money: money, user_id: user_id, type: type},
+            dataType: "json",
+            success: function (msg) {
+                $("#layui-layer-content2").html(msg['msg'])
+                $("#layui-layer3").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            },
+            error: function () {
+                $("#layui-layer-content2").html("错误:链接不到服务器")
+                $("#layui-layer3").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            }
+        });
+    }
     layui.use('laydate', function(){
       var laydate = layui.laydate;
 
@@ -73,4 +157,4 @@
         })
     });
 </script>
-{/block}
+{/block}

+ 8 - 3
application/common/model/User.php

@@ -18,10 +18,15 @@ class User extends Model
      * @param string $order 排序
      * @return array
      */
-    public function getUserList($condition = array(), $field = '*', $page = 0, $order = 'user_id desc')
+    public function getUserList($condition = array(), $field = '*', $page = 0, $order = 'user_addTime desc')
     {
         if ($page) {
-            $user_list = db('user')->where($condition)->order($order)->paginate($page, false, ['query' => request()->param()]);
+            $user_list = db('user')
+                ->alias('a')
+                ->join('userinfo b','b.user_id = a.user_id')
+                ->where($condition)
+                ->order($order)
+                ->paginate($page, false, ['query' => request()->param()]);
             $this->page_info = $user_list;
             return $user_list->items();
         } else {
@@ -37,4 +42,4 @@ class User extends Model
         return db('member')->field($field)->where($condition)->find();
     }
 
-}
+}

+ 19 - 3
application/home/controller/Product.php

@@ -164,10 +164,12 @@ class Product extends Common
             $dbUserInfo = model('Userinfo');
             $dbUserProduct = model('Userproduct');
             $dbOrder = model('Order');
+            $capitalMovements = model('CapitalMovements');
             $dbUserInfo->startTrans();
             $dbUserProduct->startTrans();
             $dbOrder->startTrans();
-            /*try {*/
+            $capitalMovements->startTrans();
+            try {
                 $userProduct = model('Userproduct')->findUserProduct(['user_id'=>$userId,'product_id'=>$product_id]);
                 $dbUserInfo->updateInfo($userId, ['userInfo_money' => $cashMoney]);
                 $nowDate = date('Y-m-d');
@@ -198,10 +200,23 @@ class Product extends Common
                     'order_money' => $money,
                 ];
                 $dbOrder->addOrder($addOrderData);
+                $cplMvtData = [
+                    'user_id' => $userId,
+                    'capitalMovements_describe' => '购买服务:' . $getFatherProduct->product_name . ' ▪ ' . $product->product_name,
+                    'capitalMovements_identity' => $orderID,
+                    'capitalMovements_create' => $nowDate,
+                    'capitalMovements_update' => $nowDate,
+                    'capitalMovements_money' => $money,
+                    'capitalMovements_type' => 2,
+                    'capitalMovements_cash' => $cashMoney,
+                    'capitalMovements_operator' => $userId,
+                ];
+                $capitalMovements->add($cplMvtData);
                 // 提交事务
                 $dbUserInfo->commit();
                 $dbUserProduct->commit();
                 $dbOrder->commit();
+                $capitalMovements->commit();
                 $returnData = [
                     "msg" => "恭喜你购买成功",
                     "success"=> true,
@@ -213,13 +228,14 @@ class Product extends Common
                     ]),
                 ];
                 return $returnData;
-            /*} catch (\Exception $e) {
+            } catch (\Exception $e) {
                 // 回滚事务
                 $dbUserInfo->rollBack();
                 $dbUserProduct->rollBack();
                 $dbOrder->rollBack();
+                $capitalMovements->rollBack();
                 return ["msg" => "操作失败", "success"=>false];
-            }*/
+            }
         }
         $data = json_decode(input('get.data'));//print_r($data->orderID);die;
         $this->assign('data', $data);

+ 18 - 0
application/home/model/CapitalMovements.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace app\home\model;
+
+use think\Model;
+
+class CapitalMovements extends Model
+{
+    public function add($data)
+    {
+        $result = $this
+            ->insert($data);
+
+        return $result;
+    }
+
+
+}

+ 32 - 0
application/user/controller/Cost.php

@@ -27,6 +27,14 @@ class Cost extends UserControl
             $condition['order_buyTime'] = array('between', array($begin, $end));
         }
         $allOrder = model('order')->getOrder($condition);
+        $allProduct = model('product')->getProduct();
+        foreach ($allOrder as $key=>$value) {
+            foreach ($allProduct as $k=>$va) {
+                if ($value->product_pid == $va->product_id) {
+                    $allOrder[$key]->fatherProduct = $va->product_name;
+                }
+            }
+        }
         $this->assign('allOrder', $allOrder);
         $this->assign('show_page', $allOrder->render());
         $this->assign('status', $status);
@@ -95,12 +103,36 @@ class Cost extends UserControl
         if ($type) {
             $condition['recharge_type'] = $type;
         }
+        $status = input('get.status');
+        if (strlen($status)) {
+            $condition['recharge_status'] = $status;
+        }
         $allRecharge = model('recharge')->selectRecharge($condition);
         $this->assign('allRecharge', $allRecharge);
         $this->assign('show_page', $allRecharge->render());
 
         return $this->fetch('transaction');
     }
+    public function capital()
+    {
+        $condition['user_id'] = session('user_id');
+        $time = input('get.timeRang');
+        if (!empty($time)) {
+            $gap = explode(' - ', $time);
+            $begin = $gap[0];
+            $end = date('Y-m-d', strtotime ("+1 day", strtotime($gap[1])));
+            $condition['capitalMovements_create'] = array('between', array($begin, $end));
+        }
+        $type = input('get.type');
+        if ($type) {
+            $condition['capitalMovements_type'] = $type;
+        }
+        $allCapital = model('CapitalMovements')->select($condition);
+        $this->assign('allCapital', $allCapital);
+        $this->assign('show_page', $allCapital->render());
+
+        return $this->fetch();
+    }
 
 }
 

+ 17 - 0
application/user/controller/Renewal.php

@@ -52,6 +52,7 @@ class Renewal extends UserControl
         $userProduct_id = input('post.renewal_id');
         $product_id = input('post.product_id');
         $product = model('product')->getProductWhere(['product_id' => $product_id, 'product_status' => 1]);
+        $fartherProduct = model('product')->getProductWhere(['product_id' => $product->product_pid]);
         if (!$product) {
             return ["msg" => "错误:该产品已停售"];
         }
@@ -82,9 +83,11 @@ class Renewal extends UserControl
         $dbUserInfo = model('Userinfo');
         $dbUserProduct = model('Userproduct');
         $dbOrder = model('Order');
+        $capitalMovements = model('CapitalMovements');
         $dbUserInfo->startTrans();
         $dbUserProduct->startTrans();
         $dbOrder->startTrans();
+        $capitalMovements->startTrans();
         try {
             $dbUserInfo->updateInfo($userId, ['userInfo_money' => $cashMoney]);
             $nowDate = date('Y-m-d');
@@ -108,16 +111,30 @@ class Renewal extends UserControl
                 'order_money' => $money,
             ];
             $dbOrder->addOrder($addOrderData);
+            $cplMvtData = [
+                'user_id' => $userId,
+                'capitalMovements_describe' => '购买服务:' . $fartherProduct->product_name . ' ▪ ' . $product->product_name,
+                'capitalMovements_identity' => $orderID,
+                'capitalMovements_create' => $nowDate,
+                'capitalMovements_update' => $nowDate,
+                'capitalMovements_money' => $money,
+                'capitalMovements_type' => 2,
+                'capitalMovements_cash' => $cashMoney,
+                'capitalMovements_operator' => $userId,
+            ];
+            $capitalMovements->add($cplMvtData);
             // 提交事务
             $dbUserInfo->commit();
             $dbUserProduct->commit();
             $dbOrder->commit();
+            $capitalMovements->commit();
             return ["msg" => "续费成功"];
         } catch (\Exception $e) {
             // 回滚事务
             $dbUserInfo->rollBack();
             $dbUserProduct->rollBack();
             $dbOrder->rollBack();
+            $capitalMovements->rollBack();
             return ["msg" => "操作失败"];
         }
     }

+ 5 - 1
application/user/controller/UserControl.php

@@ -155,9 +155,13 @@ class UserControl extends Controller
                         'url' => url('Cost/orderManagement'),
                     ),
                     'transaction_management' => array(
-                        'text' => lang('ds_transaction_management'),
+                        'text' => '充值记录',
                         'url' => url('Cost/transaction'),
                     ),
+                    'capital_management' => array(
+                        'text' => '资金明细',
+                        'url' => url('Cost/capital'),
+                    ),
                 ),
             ),
             'renewal_management' => array(

+ 24 - 0
application/user/model/CapitalMovements.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace app\user\model;
+
+use think\Model;
+
+class CapitalMovements extends Model
+{
+    public function add($data)
+    {
+        $result = $this
+            ->insert($data);
+
+        return $result;
+    }
+    public function select($condition)
+    {
+        $result = $this->where($condition)->order('capitalMovements_create desc')->paginate(10);
+
+        return $result;
+    }
+
+
+}

+ 1 - 0
application/user/model/Order.php

@@ -14,6 +14,7 @@ class Order extends Model
             ->alias('a')
             ->join('product b', 'a.product_id = b.product_id')
             ->where($condition)
+            ->order('order_buyTime desc')
             ->paginate(10);
 
         return $result;

+ 1 - 1
application/user/model/Recharge.php

@@ -22,7 +22,7 @@ class Recharge extends Model
     }
     public function selectRecharge($condition)
     {
-        $result = $this->where($condition)->paginate(10);
+        $result = $this->where($condition)->order('recharge_time desc')->paginate(10);
 
         return $result;
     }

+ 1 - 0
application/user/model/Userproduct.php

@@ -39,6 +39,7 @@ class Userproduct extends Model
             ->alias('a')
             ->join('product b', 'a.product_id = b.product_id')
             ->where($condition)
+            ->order('userProduct_buyTime desc')
             ->paginate(10);
 
         return $result;

+ 85 - 0
application/user/view/cost/capital.html

@@ -0,0 +1,85 @@
+{extend name="layout:home" /}
+{block name="container"}
+<div class="layui-tab layui-tab-card">
+    <div class="layui-tab-content page-tab-content">
+        <!-- 搜索框开始 -->
+        <div class="search-form">
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <input type="text" class="layui-input" name="timeRang" id="timeRang" placeholder="选择时间段"
+                           style="width: 170px;">
+                </div>
+                <div class="layui-inline">
+                    <select style="width: 90px;" name="type" id="type" lay-verify="" class="layui-select layui-unselect layui-form-select">
+                        <option value="">全部</option>
+                        <option value="1">资金增加</option>
+                        <option value="2">资金减少</option>
+                    </select>
+                </div>
+                <div class="layui-inline">
+                    <button type="submit" class="layui-btn search-subBtn" onclick="showCurrent()">搜索</button>
+                </div>
+            </div>
+        </div>
+        <table class="layui-table lay-even">
+            <colgroup>
+                <col width="150">
+                <col width="200">
+                <col>
+            </colgroup>
+            <thead>
+            <tr>
+                <th>订单编号</th>
+                <th>描述</th>
+                <th>交易时间</th>
+                <th>金额</th>
+                <th>余额</th>
+                <th>增加/减少</th>
+            </tr>
+            </thead>
+            <tbody>
+            {if count($allCapital)}
+            {volist name="allCapital" id="value"}
+            <tr>
+                <td>{$value.capitalMovements_identity}</td>
+                <td>{$value.capitalMovements_describe}</td>
+                <td>{$value.capitalMovements_create}</td>
+                <td>{$value.capitalMovements_money}</td>
+                <td>{$value.capitalMovements_cash}</td>
+                <td>{$value.capitalMovements_type == 1 ? '增加' : '减少'}</td>
+            </tr>
+            {/volist}
+            {else}
+            <td colspan="99" style="text-align: center">无数据</td>
+            {/if}
+            </tbody>
+        </table>
+        {$show_page}
+    </div>
+</div>
+<script>
+    const myHost = "http://" + window.location.host;
+    function showCurrent() {
+        let timeRang = $("#timeRang").val();
+        let type = $("#type").val();
+        window.location.href = myHost + "/User/cost/capital.html?timeRang=" + timeRang + "&type=" + type;
+    }
+    layui.use('laydate', function(){
+        var laydate = layui.laydate;
+
+        //执行一个laydate实例
+        laydate.render({
+            elem: '#creatTime' //指定元素
+        });
+        laydate.render({
+            elem:'#timeRang',
+            range:true,
+            format: 'yyyy/MM/dd',
+            done: function(value, date){
+                /* 时间选择完成后的回调 */
+            }
+        })
+    });
+</script>
+{/block}
+

+ 3 - 3
application/user/view/cost/orderManagement.html

@@ -35,7 +35,7 @@
             <thead>
             <tr>
                 <th>订单编号</th>
-                <th>产品名称</th>
+                <th>服务名称</th>
                 <th>期限</th>
                 <th>创建时间</th>
                 <th>金额</th>
@@ -47,7 +47,7 @@
             {volist name="allOrder" id="order"}
             <tr>
                 <td>{$order.order_identity}</td>
-                <td>{$order.product_name}</td>
+                <td>{$order.fatherProduct} ▪ {$order.product_name}</td>
                 <td>{$order.order_dayNumber}</td>
                 <td>{$order.order_buyTime}</td>
                 <td>{$order.order_money}</td>
@@ -55,7 +55,7 @@
             </tr>
             {/volist}
             {else}
-            <td colspan="7" style="text-align: center">无数据</td>
+            <td colspan="99" style="text-align: center">无数据</td>
             {/if}
             </tbody>
         </table>

+ 14 - 5
application/user/view/cost/transaction.html

@@ -10,11 +10,19 @@
                            style="width: 170px;">
                 </div>
                 <div class="layui-inline">
-                    <select name="type" id="type" lay-verify="" class="layui-select layui-unselect layui-form-select">
+                    <select style="width: 90px;" name="type" id="type" lay-verify="" class="layui-select layui-unselect layui-form-select">
                         <option value="">全部</option>
                         <option value="1">支付宝支付</option>
                         <option value="2">微信支付</option>
-                        <option value="2">银行转账</option>
+                        <option value="3">银行转账</option>
+                    </select>
+                </div>
+                <div class="layui-inline">
+                    <select style="width: 90px;" name="type" id="status" lay-verify="" class="layui-select layui-unselect layui-form-select">
+                        <option value="">全部</option>
+                        <option value="1">已审核</option>
+                        <option value="2">未审核</option>
+                        <option value="0">无效</option>
                     </select>
                 </div>
                 <div class="layui-inline">
@@ -47,11 +55,11 @@
                 <td>{$recharge.recharge_money}</td>
                 <td>{$recharge.recharge_time}</td>
                 <td>{$recharge.user_money}</td>
-                <td>{$recharge.recharge_status == 1 ? '已审核' : '未审核'}</td>
+                <td>{$recharge.recharge_status == 1 ? '已审核' : ($recharge.recharge_status == 2 ? '未审核' : '无效')}</td>
             </tr>
             {/volist}
             {else}
-            <td colspan="7" style="text-align: center">无数据</td>
+            <td colspan="99" style="text-align: center">无数据</td>
             {/if}
             </tbody>
         </table>
@@ -63,7 +71,8 @@
     function showCurrent() {
         let timeRang = $("#timeRang").val();
         let type = $("#type").val();
-        window.location.href = myHost + "/User/cost/transaction.html?timeRang=" + timeRang + "&type=" + type;
+        let status = $("#status").val();
+        window.location.href = myHost + "/User/cost/transaction.html?timeRang=" + timeRang + "&type=" + type + "&status=" + status;
     }
     layui.use('laydate', function(){
         var laydate = layui.laydate;

+ 2 - 1
application/user/view/index/index.html

@@ -3,8 +3,9 @@
 <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <title>安全猫官网</title>
+    <title>AQM</title>
     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
+    <link rel="SHORTCUT ICON" href="{$Think.HOME_SITE_ROOT}/images/LOGO.png"/>
     <!-- Bootstrap 3.3.7 -->
     <link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/layui/css/layui.css">
     <link rel="stylesheet" href="{$Think.USER_SITE_ROOT}/css/admin.css">

+ 1 - 1
application/user/view/message/index.html

@@ -49,7 +49,7 @@
             </tr>
             {/volist}
             {else}
-            <td colspan="7" style="text-align: center">无数据</td>
+            <td colspan="99" style="text-align: center">无数据</td>
             {/if}
             </tbody>
         </table>

+ 3 - 2
application/user/view/renewal/index.html

@@ -67,7 +67,7 @@
             </colgroup>
             <thead>
             <tr>
-                <th>产品名称</th>
+                <th>服务名称</th>
                 <th>所属类别</th>
                 <th>产品报价</th>
                 <th>到期时间</th>
@@ -90,7 +90,7 @@
             </tr>
             {/volist}
             {else}
-            <td colspan="7" style="text-align: center">无数据</td>
+            <td colspan="99" style="text-align: center">无数据</td>
             {/if}
             </tbody>
         </table>
@@ -116,6 +116,7 @@
     function hiddenTips2() {
         $("#layui-layer3").attr("style","display: none")
         $("#layui-layer-shade4").attr("style","display: none")
+        window.location.href = myHost + "/Admin/renewal/index.html";
     }
     function onchangeSelect() {
         let name = $("#selectTime").find("option:selected").attr("name");