wupengfei 3 年之前
父節點
當前提交
f4de3a862b

+ 51 - 0
application/store/controller/LevelLog.php

@@ -0,0 +1,51 @@
+<?php
+
+
+namespace app\store\controller;
+
+use library\Controller;
+use think\Db;
+
+/**
+ * 会员等级
+ * Class Integral
+ * @package app\store\controller
+ */
+class LevelLog extends Controller
+{
+    protected  $table ="MemberLevelLog";
+
+
+    /**
+     * 等级变更列表
+     * @auth true
+     * @menu true
+     */
+    public function index()
+    {
+        $this->title = '等级变更列表';
+        $query = $this->_query($this->table);
+        $where= [];
+        if($this->request->request('user_name'))      $where[]= ['m.name','like','%'.$this->request->request('user_name').'%'];
+        $query->alias('i')
+            ->field('i.* ,m.headimg,m.name,m.phone,l.name as lev_name')
+            ->join('store_member m',' m.id = i.user_id ','LEFT')
+            ->join('member_level l',' l.id = i.after_lev ','LEFT');
+        if(!empty($where)) $query->where($where);
+        $query ->order('i.id desc')->page();
+    }
+
+    /**
+     * 删除等级日志
+     * @auth true
+     * @menu true
+     */
+    public function del()
+    {
+        $this->_save($this->table, ['is_deleted' => 1]);
+    }
+
+
+
+
+}

+ 52 - 0
application/store/view/level_log/index.html

@@ -0,0 +1,52 @@
+{extend name='admin@main'}
+{block name="content"}
+<div class="think-box-shadow">
+    {include file='level_log/index_search'}
+    <table class="layui-table margin-top-10" lay-skin="line">
+        {notempty name='list'}
+        <thead>
+        <tr>
+            <th class='text-left nowrap'>头像</th>
+            <th class='text-left nowrap'>名称</th>
+            <th class='text-left nowrap'>变更等级</th>
+            <th class='text-left nowrap'>描述</th>
+            <th class="text-center nowrap">时间</th>
+        </tr>
+        </thead>
+        {/notempty}
+        <tbody>
+        {foreach $list as $key=>$vo}
+        <tr>
+            <td class='list-table-check-td think-checkbox'>{notempty name='vo.headimg'}<img data-tips-image style="width:20px;height:20px;vertical-align:top" src="{$vo.headimg|default=''}" class="margin-right-5">{/notempty}</td>
+            <td class='text-left nowrap'>{$vo.name|default='--'}</td>
+            <td class='text-left nowrap'>{$vo.lev_name|default='--'}</td>
+            <td class='text-left nowrap'>{$vo.desc|default='--'}</td>
+            <td class='text-center nowrap'>{$vo.create_at}</td>
+        </tr>
+        {/foreach}
+        </tbody>
+    </table>
+    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
+</div>
+<script>
+    function btn_confirm(msg,fun,id) {
+        layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
+            var url = "/store/integral/"+fun;
+            layer.closeAll();
+            $.ajax({
+                type: "post",
+                url: url,
+                data: {id:id},
+                dataType: "json",
+                async: false,
+                success: function (data) {
+                    layer.msg(data.info);
+                    setTimeout(function () {
+                        window.location.reload();
+                    },1000)
+                }
+            });
+        });
+    }
+</script>
+{/block}

+ 17 - 0
application/store/view/level_log/index_search.html

@@ -0,0 +1,17 @@
+<fieldset>
+    <legend>条件搜索</legend>
+    <form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
+
+        <div class="layui-form-item layui-inline">
+            <label class="layui-form-label">会员名称</label>
+            <div class="layui-input-inline">
+                <input name="user_name" value="{$Think.get.user_name|default=''}" placeholder="请输入会员名称" class="layui-input">
+            </div>
+        </div>
+
+        <div class="layui-form-item layui-inline">
+            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
+        </div>
+    </form>
+    <script>form.render()</script>
+</fieldset>