Преглед на файлове

add: 后台查询开奖结果

joe преди 4 години
родител
ревизия
6b0071069c
променени са 3 файла, в които са добавени 189 реда и са изтрити 1 реда
  1. 42 0
      app/admin/controller/system/SystemAwardHistory.php
  2. 144 0
      app/admin/view/system/system_award_history/index.php
  3. 3 1
      docs/TODO

+ 42 - 0
app/admin/controller/system/SystemAwardHistory.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace app\admin\controller\system;
+
+use app\admin\controller\AuthController;
+use crmeb\services\{UtilService, JsonService as Json};
+use app\models\system\SystemAwardHistory as SystemAwardHistoryModel;
+
+
+/**
+ * 活动奖励记录
+ */
+class SystemAwardHistory extends AuthController
+{
+    public function index()
+    {
+        return $this->fetch();
+    }
+
+    public function getAwardHistory()
+    {
+        $where = UtilService::getMore([
+            ['page', 1],
+            ['limit', 20],
+            ['activity', ''],
+            ['period', ''],
+        ]);
+        $model = SystemAwardHistoryModel::page(intval($where['page']), intval($where['limit']));
+        if ($where['activity']) {
+            $model = $model->where('activity', $where['activity']);
+        }
+        if ($where['period']) {
+            list($startTime, $endTime) = explode(' - ', $where['period']);
+            $model = $model->where('ts', '>', strtotime($startTime));
+            $model = $model->where('ts', '<', strtotime($endTime) + 24 * 3600);
+        }
+        $list = $model->field('*, FROM_UNIXTIME(ts, "%Y-%m-%d %H:%i:%s") as stime')->order('ts desc')->select();
+        $count = $model->count();
+
+        return Json::successlayui(['count'=>$count, 'data'=>$list]);
+    }
+}

+ 144 - 0
app/admin/view/system/system_award_history/index.php

@@ -0,0 +1,144 @@
+{extend name="public/container"}
+{block name="head_top"}
+<style>
+    .layui-btn-xs{margin-left: 0px !important;}
+    legend{
+        width: auto;
+        border: none;
+        font-weight: 700 !important;
+    }
+    .site-demo-button{
+        padding-bottom: 20px;
+        padding-left: 10px;
+    }
+    .layui-form-label{
+        width: auto;
+    }
+    .layui-input-block input{
+        width: 50%;
+        height: 34px;
+    }
+    .layui-form-item{
+        margin-bottom: 0;
+    }
+    .layui-input-block .time-w{
+        width: 200px;
+    }
+    .layui-table-body{overflow-x: hidden;}
+    .layui-btn-group button i{
+        line-height: 30px;
+        margin-right: 3px;
+        vertical-align: bottom;
+    }
+    .back-f8{
+        background-color: #F8F8F8;
+    }
+    .layui-input-block button{
+        border: 1px solid #e5e5e5;
+    }
+    .avatar{width: 50px;height: 50px;}
+    .layui-table-body{
+        overflow-x: unset;
+    }
+</style>
+{/block}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>记录过滤</h5>
+                <div class="ibox-tools">
+                    <a class="collapse-link">
+                        <i class="fa fa-chevron-up"></i>
+                    </a>
+                </div>
+            </div>
+            <div class="ibox-content" style="display: block;">
+                <form class="layui-form">
+                    <div class="layui-form-item">
+                        <div class="layui-inline">
+                            <label class="layui-form-label">活动类型:</label>
+                            <div class="layui-input-inline">
+                                <select name="activity" lay-verify="activity">
+                                    <option value="">全部</option>
+                                    <option value="clr">神抢手</option>
+                                    <option value="lucky">幸运2021</option>
+                                </select>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <div class="layui-inline">
+                            <label class="layui-form-label">选择时间段:</label>
+                            <div class="layui-input-inline">
+                                <input type="text" class="layui-input time-w" name="period" lay-verify="period"  id="period" placeholder=" - ">
+                            </div>
+                        </div>
+                    </div>
+                    <div class="layui-form-item">
+                        <label class="layui-form-label">
+                            <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="search" >
+                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>过滤</button>
+                        </label>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox">
+            <div class="ibox-content">
+                <div class="table-responsive">
+                    <div class="layui-btn-group conrelTable">
+                        <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" data-type="refresh"><i class="layui-icon layui-icon-refresh" ></i>刷新</button>
+                    </div>
+                    <table class="layui-hide" id="systemAwardList" lay-filter="systemAwardList"></table>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
+<script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
+{/block}
+{block name="script"}
+<script>
+    layList.form.render();
+    layList.tableList('systemAwardList',"{:Url('getAwardHistory')}",function () {
+        return [
+            {field: 'id', title: '编号',width:'6%',align:'center'},
+            {field: 'activity', title: '活动代码',align:'center',width:'8%'},
+            {field: 'result', title: '开奖',align:'center',width:'6%'},
+            {field: 'order_num', title: '订单总数',align:'center',width:'8%'},
+            {field: 'winner_num', title: '获奖订单数',width:'8%',align:'center'},
+            {field: 'total_paid', title: '订单总金额',align:'center',width:'15%'},
+            {field: 'profit', title: '盈利',align:'center',width:'12%'},
+            {field: 'diff_paid', title: '订单差额',width:'12%',align:'center'},
+            {field: 'rate', title: '赔付比率',align:'center',width:'8%'},
+            {field: 'stime', title: '时间',width:'15%',align:'center'},
+        ];
+    });
+
+    layList.date('period');
+
+    layList.search('search',function(where){
+        layList.reload(where,true);
+    });
+
+    var action={
+        refresh:function () {
+            layList.reload();
+        }
+    };
+    $('.conrelTable').find('button').each(function () {
+        var type=$(this).data('type');
+        $(this).on('click',function () {
+            action[type] && action[type]();
+        })
+    })
+
+</script>
+{/block}

+ 3 - 1
docs/TODO

@@ -32,7 +32,9 @@
 
 # 增加任意用户的所有下级查询,及其指定时间段的订单查询,流水查询
 
-# 增加 幸运2021 结果查询接口
+# __后台增加 幸运2021 结果查询__
+
+# 增加 websocket 查询接口供官网和第三方查询, 支持推送
 
 # __增加用户挖矿余额,提币记录查询__