Эх сурвалжийг харах

Merge branch 'master' of http://git.bocai108.com:10180/Ethan/Home-Data

Jonlin 6 жил өмнө
parent
commit
4beea2c094

+ 7 - 0
application/common.php

@@ -635,3 +635,10 @@ function ds_substing($string, $start=0,$length=80) {
 function page_mobile($page){
 
 }
+
+function OrderID($prefix = '') {
+    $num = mt_rand(100, 999);
+    list($s, $m) = explode(' ', microtime());
+    $order = date("YmdHis") . ($s * 1000000) . $num;
+    return $prefix . $order;
+}

+ 57 - 10
application/user/controller/Cost.php

@@ -3,16 +3,6 @@
 namespace app\user\controller;
 use think\Lang;
 
-//数据库备份根路径
-define('DATA_BACKUP_PATH', 'uploads/sqldata/');
-//数据库备份卷大小  20971520表示为 20M
-//define('DATA_BACKUP_PART_SIZE', 20971520);
-define('DATA_BACKUP_PART_SIZE', 1024 * 1024 * 10);
-//数据库备份文件是否启用压缩
-define('DATA_BACKUP_COMPRESS', 0);
-//数据库备份文件压缩级别
-define('DATA_BACKUP_COMPRESS_LEVEL', 9);
-
 class Cost extends UserControl
 {
 
@@ -50,10 +40,67 @@ class Cost extends UserControl
         $this->assign('userInfo', $userInfo);
         $status = input('get.status');
         $this->assign('status', $status);
+        $systemPayment = model('systempayment')->getSystempayment($userId);
+        $zhifubao = '';
+        $weixin = '';
+        $bank = '';
+        foreach ($systemPayment as $value) {
+            if ($value->systemPayment_type == 1 && $value->systemPayment_status == 1) {
+                $zhifubao = $value;
+            } elseif ($value->systemPayment_type == 2 && $value->systemPayment_status == 1) {
+                $weixin = $value;
+            } elseif ($value->systemPayment_type == 3 && $value->systemPayment_status == 1) {
+                $bank = $value;
+            }
+        }
+        $this->assign('zhifubao', $zhifubao);
+        $this->assign('weixin', $weixin);
+        $this->assign('bank', $bank);
 
 
         return $this->fetch('recharge');
     }
+    public function rechargeSubmit()
+    {
+        $data['recharge_type'] = input('post.type');
+        $data['recharge_identity'] = input('post.orderNumber');
+        $getRecharge = model('recharge')->getRecharge($data);
+        if ($getRecharge) {
+            return ["msg"=>"错误:已提交过该订单号"];
+        }
+        $userId = session('user_id');
+        $getInfo = model('userinfo')->getInfo($userId);
+        $data['user_id'] = session('user_id');
+        $data['user_money'] = $getInfo->userInfo_money;
+        $data['recharge_time'] = date('Y-m-d H:i:s');
+        $data['recharge_status'] = 2;
+        $addBack = model('recharge')->addRecharge($data);
+        if ($addBack) {
+            return ["msg"=>"成功:人工操作流程较长,金额预计在操作完成后2-3天到账,请耐心等待"];
+        } else {
+            return ["msg"=>"错误:系统错误,请重新提交"];
+        }
+    }
+    public function transaction()
+    {
+        $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['recharge_time'] = array('between', array($begin, $end));
+        }
+        $type = input('get.type');
+        if ($type) {
+            $condition['recharge_type'] = $type;
+        }
+        $allRecharge = model('recharge')->selectRecharge($condition);
+        $this->assign('allRecharge', $allRecharge);
+        $this->assign('show_page', $allRecharge->render());
+
+        return $this->fetch('transaction');
+    }
 
 }
 

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

@@ -0,0 +1,107 @@
+<?php
+
+namespace app\user\controller;
+use think\Lang;
+
+class Renewal extends UserControl
+{
+
+    public function _initialize()
+    {
+        parent::_initialize(); // TODO: Change the autogenerated stub
+        Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/db.lang.php');
+
+    }
+    public function index()
+    {
+        $condition['user_id'] = session('user_id');
+        $type = input('get.type');
+        $nowDate = date('Y-m-d');
+        if (count($type)) {
+            if ($type > 0) {
+                $maturityTime = date('Y-m-d', strtotime ($type . " day"));
+                $condition['userProduct_maturityTime'] = array('between', array($nowDate, $maturityTime));
+            } else {
+                $condition['userProduct_maturityTime'] = array('<', $nowDate);
+            }
+        }
+        $userProduct = model('Userproduct')->getUserProduct($condition);
+        $fatherProduct = model('product')->getProduct($condition);
+        $productData = [];
+        foreach ($fatherProduct as $v) {
+            $productData[$v->product_id] = $v->product_name;
+        }
+        foreach ($userProduct as $key => $v) {
+            $userProduct[$key]->fatherProduct = $productData[$v->product_pid];
+            $userProduct[$key]->status = $nowDate > $v->userProduct_maturityTime ? '已过期' : '正常';
+        }
+        $this->assign('userProduct', $userProduct);
+        $this->assign('show_page', $userProduct->render());
+        $getRenewal = model('renewal')->getRenewal();
+        $this->assign('renewalType', $getRenewal);
+
+        return $this->fetch('index');
+    }
+    public function renewal()
+    {
+        $userId = session('user_id');
+        $type = input('post.type');
+        $userProduct_id = input('post.renewal_id');
+        $product_id = input('post.product_id');
+        $product = model('product')->getProductWhere(['product_id'=>$product_id, 'product_status'=>1]);
+        if(!$product) {
+            return ["msg"=>"错误:该产品已停售"];
+        }
+        $userInfo = model('userinfo')->getInfo($userId);
+        switch (intval($type)) {
+            case 1:
+                $money = $product->product_TypeOne;
+                break;
+            case 2:
+                $money = $product->product_TypeTwo;
+                break;
+            case 3:
+                $money = $product->product_TypeThree;
+                break;
+            default:
+                $money = $product->product_TypeFour;
+        }
+        if ($userInfo->userInfo_money >= $money) {
+            $findRenewal = model('renewal')->findRenewal(['renewal_status'=>1,'renewal_identity'=>$type]);
+        } else {
+            return ["msg"=>"错误:您的余额不足"];
+        }
+        if (!$findRenewal) {
+            return ["msg"=>"错误:该期限已不支持购买"];
+        }
+
+        $day = $findRenewal->renewal_day;
+        $cashMoney = $userInfo->userInfo_money - $money;
+        /*$model = model('userinfo');
+        $model->startTrans();*/
+        $updateUserInfo = model('userinfo')->updateInfo($userId, ['userInfo_money' => $cashMoney]);
+        $nowDate = date('Y-m-d');
+        $userProduct = model('Userproduct')->findUserProduct(['userProduct_id' => $userProduct_id]);
+        $data['userProduct_dayNumber'] = $userProduct->userProduct_dayNumber + $day;
+        $data['userproduct_identity'] = OrderID();
+        $data['userProduct_buyTime'] = $nowDate;
+        /*if ($userProduct->userProduct_maturityTime > $nowDate) {
+            $data['userProduct_maturityTime'] = date('Y-m-d', strtotime(intval($day) . " day", strtotime($userProduct->userProduct_maturityTime)));
+        } else {
+            $data['userProduct_maturityTime'] = date('Y-m-d', strtotime(intval($day) . " day", $nowDate));
+        }*/
+        $updateUserProduct = model('Userproduct')->updateUserProduct(['userProduct_id' => $userProduct_id], $data);
+        // 提交事务
+        if ($updateUserInfo && $updateUserProduct) {
+            /*$model->commit();*/
+            return ["msg" => "续费成功"];
+        } else {
+            // 回滚事务
+            /*$model->rollBack();*/
+            return ["msg" => "操作失败"];
+        }
+    }
+
+}
+
+?>

+ 2 - 2
application/user/controller/UserControl.php

@@ -156,14 +156,14 @@ class UserControl extends Controller
                     ),
                     'transaction_management' => array(
                         'text' => lang('ds_transaction_management'),
-                        'url' => url('Adv/adv_manage'),
+                        'url' => url('Cost/transaction'),
                     ),
                 ),
             ),
             'renewal_management' => array(
                 'name' => 'renewal_management',
                 'text' => lang('ds_renewal_management'),
-                'url' => url('Config/index'),
+                'url' => url('Renewal/index'),
             ),
             'access_control' => array(
                 'name' => 'access_control',

+ 28 - 0
application/user/model/Product.php

@@ -0,0 +1,28 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class Product extends Model
+{
+    public function getProduct()
+    {
+        $result = $this
+            ->where(['product_pid' => 0])
+            ->select();
+
+        return $result;
+    }
+    public function getProductWhere($condition)
+    {
+        $result = $this
+            ->where($condition)
+            ->find();
+
+        return $result;
+    }
+
+}

+ 30 - 0
application/user/model/Recharge.php

@@ -0,0 +1,30 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class Recharge extends Model
+{
+    public function addRecharge($data)
+    {
+        $result = $this->insert($data);
+
+        return $result;
+    }
+    public function getRecharge($data)
+    {
+        $result = $this->where($data)->find();
+
+        return $result;
+    }
+    public function selectRecharge($condition)
+    {
+        $result = $this->where($condition)->paginate(10);
+
+        return $result;
+    }
+
+}

+ 28 - 0
application/user/model/Renewal.php

@@ -0,0 +1,28 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class Renewal extends Model
+{
+    public function getRenewal()
+    {
+        $result = $this
+            ->where(['renewal_status' => 1])
+            ->select();
+
+        return $result;
+    }
+    public function findRenewal($condition)
+    {
+        $result = $this
+            ->where($condition)
+            ->find();
+
+        return $result;
+    }
+
+}

+ 18 - 0
application/user/model/Systempayment.php

@@ -0,0 +1,18 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 用户管理
+ */
+class Systempayment extends Model
+{
+    public function getSystempayment()
+    {
+        $result = $this->select();
+
+        return $result;
+    }
+
+}

+ 0 - 34
application/user/model/UserInfo.php

@@ -1,34 +0,0 @@
-<?php
-namespace app\user\model;
-
-use think\Model;
-
-/**
- * 主页导航管理模型
- */
-class User extends Model
-{
-
-
-    /**
-     * 主页文字获取
-     *
-     * @access public
-     * @param mixed $field 查询字段
-     * @param mixed $where 条件
-     * @param mixed $order 排序
-     * @return array 返回类型
-     */
-    public function getSelect($field, $where=[], $order='product_id asc')
-    {
-        $result = $this->field($field);
-        if (empty($where) === false) {
-            $result = $result->where($where);
-        }
-
-        $result = $result->order($order)->select();
-        return $result;
-    }//endgetSelect()
-
-
-}

+ 25 - 0
application/user/model/Userinfo.php

@@ -0,0 +1,25 @@
+<?php
+namespace app\user\model;
+
+use think\Model;
+
+/**
+ * 主页导航管理模型
+ */
+class Userinfo extends Model
+{
+    public function getInfo($userId)
+    {
+        $result = $this->where(['user_id'=>$userId])->find();
+
+        return $result;
+    }
+    public function updateInfo($userId, $data)
+    {
+        $result = $this->where(['user_id'=>$userId])->update($data);
+
+        return $result;
+    }
+
+
+}

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

@@ -33,5 +33,31 @@ class Userproduct extends Model
 
         return $count;
     }
+    public function getUserProduct($condition)
+    {
+        $result = $this
+            ->alias('a')
+            ->join('product b', 'a.product_id = b.product_id')
+            ->where($condition)
+            ->paginate(10);
+
+        return $result;
+    }
+    public function findUserProduct($condition)
+    {
+        $result = $this
+            ->where($condition)
+            ->find();
+
+        return $result;
+    }
+    public function updateUserProduct($condition, $data)
+    {
+        $result = $this
+            ->where($condition)
+            ->update($data);
+
+        return $result;
+    }
 
 }

+ 5 - 5
application/user/view/all/index.html

@@ -11,22 +11,22 @@
             <tbody>
             <tr>
                 <td>{$Think.lang.all_money}</td>
-                <td>{$userInfo->userInfo_money}<a style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_recharge}</a></td>
+                <td>{$userInfo->userInfo_money}<a href="/User/Cost/recharge.html" style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_recharge}</a></td>
             </tr>
             <tr>
                 <td>{$Think.lang.all_holding_products}</td>
-                <td>{$countProduct}<a style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_view_orders}</a></td>
+                <td>{$countProduct}<a style="float: right; margin-left: 5px; cursor:pointer">查看</a></td>
             </tr>
             <tr>
                 <td>{$Think.lang.all_renew}</td>
-                <td>{$renewProduct}<a style="float: right; margin-left: 5px; cursor:pointer">{$Think.lang.all_view_renew_orders}</a></td>
+                <td>{$renewProduct}<a style="float: right; margin-left: 5px; cursor:pointer">查看</a></td>
             </tr>
             </tbody>
         </table>
     </div>
 
 
-    <h1 style="width: 35%; float: left">{$Think.lang.wel_sys_info}</h1>
+    <!--<h1 style="width: 35%; float: left">{$Think.lang.wel_sys_info}</h1>
     <table class="layui-table lay-even" style="width: 35%; float: left">
         <tbody>
         <tr>
@@ -58,7 +58,7 @@
             <td>{$statistics.zlib}</td>
         </tr>
         </tbody>
-    </table>
+    </table>-->
 </div>
 
 {/block}

+ 2 - 8
application/user/view/cost/orderManagement.html

@@ -22,7 +22,7 @@
                            style="width: 170px;">
                 </div>
                 <div class="layui-inline">
-                    <button type="submit" class="layui-btn search-subBtn" onclick="showCurrent('', '', '', '')">搜索</button>
+                    <button type="submit" class="layui-btn search-subBtn" onclick="showCurrent('')">搜索</button>
                 </div>
             </div>
         </div>
@@ -40,7 +40,6 @@
                 <th>创建时间</th>
                 <th>金额</th>
                 <th>状态</th>
-                <th>操作</th>
             </tr>
             </thead>
             <tbody>
@@ -52,12 +51,7 @@
                 <td>{$order.order_dayNumber}</td>
                 <td>{$order.order_buyTime}</td>
                 <td>{$order.order_money}</td>
-                <td>{$order.order_status}</td>
-                <td>
-                    <a href="" class="layui-btn layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>{$Think.lang.ds_edit}</a>
-                    <a href="" class="layui-btn layui-btn-xs layui-btn-danger"><i
-                            class="layui-icon layui-icon-delete"></i>{$Think.lang.ds_del}</a>
-                </td>
+                <td>{$order.order_status == 1 ? '成功' : '失败'}</td>
             </tr>
             {/volist}
             {else}

+ 125 - 11
application/user/view/cost/recharge.html

@@ -1,6 +1,14 @@
 {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-layer2" type="dialog" times="2" showtime="0" contype="string">
+        <div id="layui-layer-content" class="layui-layer-content"></div>
+        <span class="layui-layer-setwin" onclick="hiddenTips()"><a class="layui-layer-ico layui-layer-close layui-layer-close2"
+                                            href="javascript:;"></a></span>
+        <div class="layui-layer-btn layui-layer-btn-" onclick="hiddenTips()"><a class="layui-layer-btn0">确定</a></div>
+        <span class="layui-layer-resize"></span>
+    </div>
     <div class="explanation" id="explanation" style="margin: 20px 0 20px 0">
         <div style="font-size: 18px">
             <span style="margin-left: 20px;">余额:</span>
@@ -20,20 +28,102 @@
             <a>银行转账</a>
         </li>
     </ul>
-    <div class="layui-tab-content page-tab-content">
-        <div>
-            <img src="">
-            <span>请用支付宝扫描下面二维码进行充值</span>
+    {if $status == 3}
+        {if $bank}
+        <div class="layui-tab-content page-tab-content" style="font-size: 18px; display: flex">
+            <div style="font-size: 17px; width: 300px">
+                <div style="margin-top: 20px; display: flex">
+                    <div style="min-width: 100px;">开户名称:</div>
+                    <div>{$bank->systemPayment_name}</div>
+                </div>
+                <div style="margin-top: 20px; display: flex">
+                    <div style="min-width: 100px;">开户银行:</div>
+                    <div>{$bank->systemPayment_bank}</div>
+                </div>
+                <div style="margin-top: 20px;flex:1; display: flex">
+                    <div style="min-width: 100px;">专属账号:</div>
+                    <div>{$bank->systemPayment_account}</div>
+                </div>
+            </div>
+            <div style="margin-left: 80px; margin-right: 30px; border-left: 1px solid #ccc;">
+            </div>
+            <div style="margin-top: 20px;">
+                <span style="">充值成功?请输入您的订单号</span>
+                <input id="orderNumber3" type="text" class="layui-input" name="timeRang" placeholder="请输入订单号"
+                       style="width: 300px; margin-top: 20px;">
+                <div class="layui-inline" style="margin-top: 20px;">
+                    <button type="submit" class="layui-btn search-subBtn" onclick="submit(3)">确定</button>
+                </div>
+            </div>
         </div>
-        <div>
-            <img src="{$Think.UPLOADS_ROOT}/jquery-2.1.4.min.js">
+        {else}
+        <div class="layui-tab-content page-tab-content" style="font-size: 18px; display: flex; height: 230px; justify-content: center;">
+            <div style="margin-top: 50px">
+                <span>暂不支持银行转账</span>
+            </div>
         </div>
-        <div>
-            <span>充值成功?请输入订单号</span>
-            <input type="text" class="layui-input" name="timeRang" placeholder="选择时间段"
-                   style="width: 170px;">
+        {/if}
+    {elseif $status == 2}
+        {if $weixin}
+        <div class="layui-tab-content page-tab-content" style="font-size: 18px; display: flex">
+            <div>
+                <div style="margin-top: 20px;">
+                    <img src="{$Think.USER_SITE_ROOT}/images/weixin.png">
+                    <span>请用微信扫描下面二维码进行充值</span>
+                </div>
+                <div style="margin-top: 20px;">
+                    <img src="{$Think.UPLOADS_ROOT}/{$zhifubao->systemPayment_img}" style="width: 300px; height: 300px;">
+                </div>
+            </div>
+            <div style="margin-left: 80px; margin-right: 30px; border-left: 1px solid #ccc;">
+            </div>
+            <div style="margin-top: 20px;">
+                <span style="">充值成功?请输入您的订单号</span>
+                <input id="orderNumber2" type="text" class="layui-input" name="timeRang" placeholder="请输入订单号"
+                       style="width: 300px; margin-top: 20px;">
+                <div class="layui-inline" style="margin-top: 20px;">
+                    <button type="submit" class="layui-btn search-subBtn" onclick="submit(2)">确定</button>
+                </div>
+            </div>
         </div>
-    </div>
+        {else}
+        <div class="layui-tab-content page-tab-content" style="font-size: 18px; display: flex; height: 230px; justify-content: center;">
+            <div style="margin-top: 50px">
+                <span>暂不支持微信支付</span>
+            </div>
+        </div>
+        {/if}
+    {else}
+        {if $zhifubao}
+        <div class="layui-tab-content page-tab-content" style="font-size: 18px; display: flex">
+            <div>
+                <div style="margin-top: 20px;">
+                    <img src="{$Think.USER_SITE_ROOT}/images/zhifubao.png">
+                    <span>请用支付宝扫描下面二维码进行充值</span>
+                </div>
+                <div style="margin-top: 20px;">
+                    <img src="{$Think.UPLOADS_ROOT}/{$zhifubao->systemPayment_img}" style="width: 300px; height: 300px;">
+                </div>
+            </div>
+            <div style="margin-left: 80px; margin-right: 30px; border-left: 1px solid #ccc;">
+            </div>
+            <div style="margin-top: 20px;">
+                <span style="">充值成功?请输入您的订单号</span>
+                <input id="orderNumber1" type="text" class="layui-input" name="orderNumber" placeholder="请输入订单号"
+                       style="width: 300px; margin-top: 20px;">
+                <div class="layui-inline" style="margin-top: 20px;">
+                    <button type="submit" class="layui-btn search-subBtn" onclick="submit(1)">确定</button>
+                </div>
+            </div>
+        </div>
+        {else}
+        <div class="layui-tab-content page-tab-content" style="font-size: 18px; display: flex; height: 230px; justify-content: center;">
+            <div style="margin-top: 50px">
+                <span>暂不支持支付宝支付</span>
+            </div>
+        </div>
+        {/if}
+    {/if}
 </div>
 <script>
     const myHost = "http://" + window.location.host;
@@ -48,6 +138,30 @@
     function showCurrent(id1) {
         window.location.href = myHost + "/User/cost/recharge.html?&status=" + id1;
     }
+    function hiddenTips() {
+        $("#layui-layer2").attr("style","display: none")
+        $("#layui-layer-shade4").attr("style","display: none")
+    }
+    function submit(type) {
+        let url = myHost + "/User/cost/rechargeSubmit.html";
+        let orderNumber = $("#orderNumber" + type).val();
+        $.ajax({
+            type: "post",
+            url: url,
+            data: {type: type, orderNumber: orderNumber},
+            dataType: "json",
+            success: function (msg) {
+                $("#layui-layer-content").html(msg['msg'])
+                $("#layui-layer2").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            },
+            error: function () {
+                $("#layui-layer-content").html("错误:链接不到服务器")
+                $("#layui-layer2").attr("style","display: block")
+                $("#layui-layer-shade4").attr("style","display: block")
+            }
+        });
+    }
     layui.use('laydate', function(){
         var laydate = layui.laydate;
 

+ 86 - 0
application/user/view/cost/transaction.html

@@ -0,0 +1,86 @@
+{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 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>
+                    </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($allRecharge)}
+            {volist name="allRecharge" id="recharge"}
+            <tr>
+                <td>{$recharge.recharge_identity}</td>
+                <td>{$recharge.recharge_type == 2 ? '微信支付' : ($recharge.recharge_type == 3 ? '银行转账' : '支付宝支付')}</td>
+                <td>{$recharge.recharge_money}</td>
+                <td>{$recharge.recharge_time}</td>
+                <td>{$recharge.user_money}</td>
+                <td>{$recharge.recharge_status == 1 ? '已审核' : '未审核'}</td>
+            </tr>
+            {/volist}
+            {else}
+            <td colspan="7" 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/transaction.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}
+

+ 47 - 0
application/user/view/renewal/form.html

@@ -0,0 +1,47 @@
+{extend name="layout:home" /}
+{block name="container"}
+<form class="layui-form layui-form-pane" method="post">
+    <div class="layui-tab layui-tab-card">
+        <div class="layui-tab-content page-tab-content">
+            <div class="layui-tab-item layui-show ">
+                <div class="layui-form-item">
+                    <label class="layui-form-label">{$Think.lang.admin_name}</label>
+                    <div class="layui-input-block">
+                        <input type="text" class="layui-input field-name" name="admin_name" id="admin_name" value="{$admin.admin_name|default=''}" lay-verify="admin_name" autocomplete="off" placeholder="{:lang('ds_please_enter')}{:lang('admin_name')}" required />
+                    </div>
+                </div>
+                <div class="layui-form-item" id="oajax">
+                    <label class="layui-form-label">选择续费时间</label>
+                    <div class="layui-input-block">
+                        <select name="admin_pid" lay-filter="groups">
+                            <option value="1">选择续费时间</option>
+                            <option value="1">一个月</option>
+                            <option value="2">半年</option>
+                            <option value="3">一年</option>
+                            <option value="4">三年</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <div class="layui-input-block">
+                        <input type="submit" class="layui-btn layui-btn-normal" lay-submit value="{:lang('ds_submit')}" />
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</form>
+
+<script>
+    layui.use('form', function() {
+        var form = layui.form;
+        form.on('select(groups)',function(data){
+
+        });
+    });
+
+</script>
+<script type="text/javascript" charset="utf-8">
+
+</script>
+{/block}

+ 165 - 0
application/user/view/renewal/index.html

@@ -0,0 +1,165 @@
+{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">
+                    <div class="layui-form-item" id="oajax">
+                        <label class="layui-form-label" style="width: 100px">选择续费时间:</label>
+                        <div class="layui-input-block">
+                            <select id="selectTime" onchange="onchangeSelect()" class="layui-select layui-unselect layui-form-select" name="type"
+                                    lay-filter="groups" style="width: 120px">
+                                <option value="">选择续费时间</option>
+                                {volist name="renewalType" id="value"}
+                                <option id="option_{$value.renewal_identity}" value="{$value.renewal_identity}" name="">{$value.renewal_name}</option>
+                                {/volist}
+                            </select>
+                        </div>
+                    </div>
+                    <div id="layui-layer-content" style="text-align: center; font-size: 18px; height: 24px;"></div>
+                    <input name="renewal_id" id="renewal_id" style="display: none">
+                    <input name="product_id" id="product_id" style="display: none">
+                    <div class="layui-form-item" style="margin-top: 25px">
+                        <div class="layui-input-block">
+                            <input type="submit" class="layui-btn layui-btn-normal" lay-submit onclick="submit()"
+                                   value="{:lang('ds_submit')}"/>
+                        </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">
+        <!-- 搜索框开始 -->
+        <div class="search-form">
+            <div class="layui-form-item">
+                <div class="layui-inline">
+                    <select name="type" id="type" lay-verify="" class="layui-select layui-unselect layui-form-select">
+                        <option value="">全部</option>
+                        <option value="30">30天内到期</option>
+                        <option value="7">7天内到期</option>
+                        <option value="0">已过期</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($userProduct)}
+            {volist name="userProduct" id="product"}
+            <tr>
+                <td>{$product.product_name}</td>
+                <td>{$product.fatherProduct}</td>
+                <td>{$product.product_money}</td>
+                <td>{$product.userProduct_maturityTime}</td>
+                <td>{$product.status}</td>
+                <td>
+                    <a onclick="renewal({$product.userProduct_id}, {$product.product_id}, {$product.product_TypeOne}, {$product.product_TypeTwo}, {$product.product_TypeThree}, {$product.product_TypeFour})" class="layui-btn layui-btn-xs">续费</a>
+                </td>
+            </tr>
+            {/volist}
+            {else}
+            <td colspan="7" style="text-align: center">无数据</td>
+            {/if}
+            </tbody>
+        </table>
+        {$show_page}
+    </div>
+</div>
+<script>
+    const myHost = "http://" + window.location.host;
+    function renewal(userProduct_id, product_id, money1, money2, money3, money4) {
+        $("#layui-layer2").attr("style","display: block")
+        $("#layui-layer-shade4").attr("style","display: block")
+        $("#renewal_id").val(userProduct_id);
+        $("#product_id").val(product_id);
+        $("#option_1").attr("name","需支付"+money1+"元");
+        $("#option_2").attr("name","需支付"+money2+"元");
+        $("#option_3").attr("name","需支付"+money3+"元");
+        $("#option_4").attr("name","需支付"+money4+"元");
+    }
+    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")
+    }
+    function onchangeSelect() {
+        let name = $("#selectTime").find("option:selected").attr("name");
+        $("#layui-layer-content").html(name)
+    }
+    function submit() {
+        let url = myHost + "/User/renewal/renewal.html";
+        let renewal_id = $("#renewal_id").val();
+        let product_id = $("#product_id").val();
+        let type = $("#selectTime").find("option:selected").attr("value");
+        hiddenTips();
+        $.ajax({
+            type: "post",
+            url: url,
+            data: {type: type, product_id: product_id, renewal_id: renewal_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}
+

+ 1 - 0
public/static/admin/css/admin.css

@@ -362,3 +362,4 @@ h6 { font-size:12px;}
 .chooseTime .layui-collapse{
 	border: none !important;
 }
+

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
public/static/plugins/layui/css/modules/layer/default/layer.css


BIN
public/static/user/images/weixin.png


BIN
public/static/user/images/zhifubao.png


+ 41 - 0
public/uploads/sqldata/20190610-105124-1.sql

@@ -0,0 +1,41 @@
+-- -----------------------------
+-- Think MySQL Data Transfer 
+-- 
+-- Host     : 192.168.2.186
+-- Port     : 3306
+-- Database : ds_cms
+-- 
+-- Part : #1
+-- Date : 2019-06-10 10:51:24
+-- -----------------------------
+
+SET FOREIGN_KEY_CHECKS = 0;
+
+
+-- -----------------------------
+-- Table structure for `bm_admin`
+-- -----------------------------
+DROP TABLE IF EXISTS `bm_admin`;
+CREATE TABLE `bm_admin` (
+  `admin_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '管理员自增ID',
+  `admin_name` varchar(20) NOT NULL COMMENT '管理员名称',
+  `admin_password` varchar(32) NOT NULL COMMENT '管理员密码',
+  `admin_add_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
+  `admin_login_time` int(11) NOT NULL COMMENT '登录时间',
+  `admin_login_num` int(11) NOT NULL COMMENT '登录次数',
+  `admin_is_super` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否超级管理员',
+  `admin_group_id` smallint(6) DEFAULT '0' COMMENT '权限组ID',
+  `admin_pid` int(11) DEFAULT '0' COMMENT 'pid',
+  `admin_status` tinyint(1) DEFAULT '1' COMMENT '状态1-是0否',
+  PRIMARY KEY (`admin_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COMMENT='管理员表';
+
+-- -----------------------------
+-- Records of `bm_admin`
+-- -----------------------------
+INSERT INTO `bm_admin` VALUES ('1', 'admin', '7fef6171469e80d32c0559f88b377245', '0', '1560134914', '98', '1', '1', '', '1');
+INSERT INTO `bm_admin` VALUES ('2', 'dacheng', '7fef6171469e80d32c0559f88b377245', '1546416864', '1548230143', '10', '0', '3', '3', '1');
+INSERT INTO `bm_admin` VALUES ('3', '麦邦公司', '7fef6171469e80d32c0559f88b377245', '1546481266', '1548917242', '11', '0', '2', '0', '1');
+INSERT INTO `bm_admin` VALUES ('4', '帮麦公司', '7fef6171469e80d32c0559f88b377245', '1546824903', '1549871629', '3', '0', '2', '0', '1');
+INSERT INTO `bm_admin` VALUES ('19', '客服001', '7fef6171469e80d32c0559f88b377245', '0', '1551234292', '10', '0', '3', '4', '1');
+INSERT INTO `bm_admin` VALUES ('21', '测试公司', '7fef6171469e80d32c0559f88b377245', '1548315143', '1550130475', '2', '0', '2', '0', '1');

+ 0 - 0
public/uploads/timg.jpg → public/uploads/weixin.jpg


BIN
public/uploads/zhifubao.jpg


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно