hrjy 3 년 전
부모
커밋
761d9a6433

+ 251 - 0
app/admin/controller/many/ManyGreen.php

@@ -0,0 +1,251 @@
+<?php
+/**
+ *
+ * @author: xaboy<365615158@qq.com>
+ * @day: 2017/11/11
+ */
+
+namespace app\admin\controller\many;
+
+use app\admin\controller\AuthController;
+use app\models\user\User;
+use crmeb\repositories\OrderRepository;
+use crmeb\repositories\ShortLetterRepositories;
+use crmeb\services\{ExpressService,
+    JsonService,
+    JsonService as Json,
+    MiniProgramService,
+    WechatService,
+    FormBuilder as Form,
+    CacheService,
+    UtilService as Util};
+use app\admin\model\ump\StorePink;
+use crmeb\basic\BaseModel;
+use think\facade\Route as Url;
+use crmeb\services\YLYService;
+use think\facade\Log;
+use think\facade\Validate;
+
+/**
+ * 订单管理控制器 同一个订单表放在一个控制器
+ * Class StoreOrder
+ * @package app\admin\controller\store
+ */
+class ManyGreen extends AuthController
+{
+    /**
+     * @return mixed
+     */
+    public function index()
+    {
+
+        return $this->fetch();
+    }
+
+
+    public function list()
+    {
+        $where = Util::getMore([
+            ['status', ''],
+            ['page', 1],
+            ['limit', 20],
+            ['name', '']
+        ]);
+
+        return Json::successlayui(\app\admin\model\many\ManyGreen::list($where));
+    }
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function create($id = 0)
+    {
+        $f = [];
+        $f[] = Form::select('uid', '赠送用户')->setOptions(function () {
+            $model = new User();
+            $list = $model->select();
+            $menus = [];
+            foreach ($list as $menu) {
+                $menus[] = ['value' => $menu['uid'], 'label' => $menu['nickname']];
+            }
+            return $menus;
+        })->filterable(1);
+        $form = Form::make_post_form('添加', $f, Url::buildUrl('save'));
+        $this->assign(compact('form'));
+        return $this->fetch('public/form-builder');
+
+
+    }
+
+    public function save()
+    {
+        $model = new \app\admin\model\many\ManyGreen();
+        $data = Util::postMore([
+            'uid',
+        ]);
+        $validate = Validate::rule([
+            'uid' => 'require',
+        ]);
+        $validate->message([
+            'uid.require' => '赠送用户不能为空',
+        ]);
+        if (!$validate->check($data)) {
+            return Json::fail($validate->getError());
+        }
+
+        $res = $model->save(['uid' => $data['uid'], 'type' => 2]);
+        if ($res) return Json::successful('赠送成功');
+        return Json::fail('赠送失败');
+    }
+
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function edit($id = 0)
+    {
+        $data = \app\admin\model\many\Many::find($id);
+        $f = [];
+        $f[] = Form::input('name', '名称',$data->getData('name'))->col(12);
+        $f[] = Form::frameImageOne('image', '封面图(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $data->getData('image'))->icon('image')->width('100%')->height('500px');
+        $f[] = Form::input('money', '额度', $data->getData('money'));
+        $f[] = Form::input('number', '数量',$data->getData('number'));
+        $f[] = Form::dateTime('add_time', '开启时间', date('Y-m-d H:i:s', $data->getData('add_time')));
+        $f[] = Form::dateTime('end_time', '结束时间', date('Y-m-d H:i:s', $data->getData('end_time')));
+        $f[] = Form::input('sort', '排序',$data->getData('sort'));
+        $f[] = Form::hidden('id', $id);
+        $form = Form::make_post_form('修改', $f, Url::buildUrl('update'));
+        $this->assign(compact('form'));
+        return $this->fetch('public/form-builder');
+    }
+
+
+    /**
+     * 修改
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function update()
+    {
+        $model = new \app\admin\model\many\Many();
+        $data = Util::postMore([
+            'id',
+            'name',
+            'image',
+            'money',
+            'number',
+            'add_time',
+            'end_time',
+            'sort',
+        ]);
+        $validate = Validate::rule('name', 'require')->rule([
+            'name' => 'require',
+            'image' => 'require',
+            'money' => 'require',
+            'number' => 'require',
+            'add_time' => 'require',
+            'end_time' => 'require',
+        ]);
+        $validate->message([
+            'name.require' => '名称不能为空',
+            'image.require' => '图片不能为空',
+            'money.require' => '额度不能为空',
+            'number.require' => '数量不能为空',
+            'add_time.require' => '请选择进场时间',
+            'end_time.require' => '请选择结束时间',
+        ]);
+        if (!$validate->check($data)) {
+            return Json::fail($validate->getError());
+        }
+        $details = $model->find($data['id']);
+        $details['name'] = $data['name'];
+        $details['image'] = $data['image'];
+        $details['money'] = $data['money'];
+        $details['number'] = $data['number'];
+        $details['add_time'] = strtotime($data['add_time']);
+        $details['end_time'] = strtotime($data['end_time']);
+        $details['sort'] = $data['sort'];
+        $res = $details->save();
+        if ($res) return Json::successful('添加成功');
+        return Json::fail('添加失败');
+    }
+
+    /**
+     * 显示创建资源表单页.
+     *
+     * @return \think\Response
+     */
+    public function next($id = 0)
+    {
+        $f = [];
+        $f[] = Form::dateTime('add_time', '开启时间');
+        $f[] = Form::dateTime('end_time', '结束时间');
+        $f[] = Form::hidden('id', $id);
+        $form = Form::make_post_form('添加', $f, Url::buildUrl('next_save'));
+        $this->assign(compact('form'));
+        return $this->fetch('public/form-builder');
+    }
+
+    public function next_save()
+    {
+        $model = new \app\admin\model\many\Many();
+        $data = Util::postMore([
+            'id',
+            'add_time',
+            'end_time',
+        ]);
+        $validate = Validate::rule([
+            'add_time' => 'require',
+            'end_time' => 'require',
+        ]);
+        $validate->message([
+            'add_time.require' => '请选择进场时间',
+            'end_time.require' => '请选择结束时间',
+        ]);
+        if (!$validate->check($data)) {
+            return Json::fail($validate->getError());
+        }
+        $details = $model->find($data['id']);
+        if ($details['end_time'] > time() or $details['status'] == 1) return Json::fail('未结束不能进行下一场');
+        if ($details['suc'] == 2) return Json::fail('已众筹失败无法就行下一场');
+
+        $details['stage'] += 1;
+        $details['status'] = 1;
+        $details['add_time'] = strtotime($data['add_time']);
+        $details['end_time'] = strtotime($data['end_time']);
+        $res = $details->save();
+        if ($res) return Json::successful('成功');
+        return Json::fail('失败');
+
+
+    }
+
+
+
+    /**
+     * 删除
+     * @param $id
+     * @return void
+     * @throws \Exception
+     */
+    public function delete($id)
+    {
+        if (!$id) Json::fail('删除失败');
+        $model = new \app\admin\model\many\Many();
+
+        $res = $model->where('id', $id)->delete();
+        if ($res){
+            return Json::success('删除成功!');
+        }else{
+            return Json::fail($model->getErrorInfo());
+        }
+
+    }
+
+}

+ 1 - 1
app/admin/controller/many/ManyOrder.php

@@ -75,7 +75,7 @@ class ManyOrder extends AuthController
     public function delete($id)
     {
         if (!$id) Json::fail('删除失败');
-        $model = new \app\admin\model\many\Many();
+        $model = new \app\admin\model\many\ManyOrder();
 
         $res = $model->where('id', $id)->delete();
         if ($res){

+ 144 - 0
app/admin/controller/user/UserEnter.php

@@ -0,0 +1,144 @@
+<?php
+/**
+ *
+ * @author: xaboy<365615158@qq.com>
+ * @day: 2017/11/11
+ */
+
+namespace app\admin\controller\user;
+
+use app\admin\controller\AuthController;
+use crmeb\repositories\OrderRepository;
+use crmeb\repositories\ShortLetterRepositories;
+use crmeb\services\{ExpressService,
+    JsonService,
+    JsonService as Json,
+    MiniProgramService,
+    WechatService,
+    FormBuilder as Form,
+    CacheService,
+    UtilService as Util};
+use app\admin\model\ump\StorePink;
+use crmeb\basic\BaseModel;
+use think\facade\Route as Url;
+use crmeb\services\YLYService;
+use think\facade\Log;
+use think\facade\Validate;
+
+/**
+ * 订单管理控制器 同一个订单表放在一个控制器
+ * Class StoreOrder
+ * @package app\admin\controller\store
+ */
+class UserEnter extends AuthController
+{
+    /**
+     * @return mixed
+     */
+    public function index()
+    {
+
+        return $this->fetch();
+    }
+
+
+    public function list()
+    {
+        $where = Util::getMore([
+            ['status', ''],
+            ['page', 1],
+            ['limit', 20],
+            ['stage', ''],
+            ['order_id', ''],
+            ['excel', 0],
+            ['data', ''],
+            ['many_id',''],
+            ['name', '']
+        ]);
+
+        return Json::successlayui(\app\admin\model\user\UserEnter::list($where));
+    }
+
+    /**
+     * 删除
+     * @param $id
+     * @return void
+     * @throws \Exception
+     */
+    public function delete($id)
+    {
+        if (!$id) Json::fail('删除失败');
+        $model = new \app\admin\model\user\UserEnter();
+
+        $res = $model->where('id', $id)->delete();
+        if ($res){
+            return Json::success('删除成功!');
+        }else{
+            return Json::fail($model->getErrorInfo());
+        }
+
+    }
+
+    /**
+     * 审核通过
+     * @param $id
+     * @return void
+     */
+    public function tg($id)
+    {
+        if (!$id) Json::fail('通过失败');
+        $model = new \app\admin\model\user\UserEnter();
+        $details = $model->find($id);
+        $details['status'] = 1;
+        $res1 = \app\models\user\User::where('uid', $details['uid'])->update(['is_merchant' => 1]);
+        $res2 = $details->save();
+        if ($res1 && $res2){
+            return Json::success('成功!');
+        }else{
+            return Json::fail($model->getErrorInfo());
+        }
+    }
+
+    /**
+     * 拒绝
+     * @param $id
+     * @return string
+     * @throws \Exception
+     */
+    public function jj($id)
+    {
+        $f = [];
+        $f[] = Form::textarea('fail_message', '不通过理由');
+        $f[] = Form::hidden('id', $id);
+        $form = Form::make_post_form('添加', $f, Url::buildUrl('jj_save'));
+        $this->assign(compact('form'));
+        return $this->fetch('public/form-builder');
+    }
+
+    /**
+     * 不通过理由
+     * @return void
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function jj_save()
+    {
+       $data = Util::postMore([
+           ['id', ''],
+           ['fail_message', '']
+       ]);
+       if (empty($data['fail_message'])) return Json::fail('填写拒绝理由');
+       if (empty($data['id']))  return Json::fail('数据不存在');
+       $details = \app\admin\model\user\UserEnter::find($data['id']);
+       $details['fail_message'] = $data['fail_message'];
+       $details['status'] = -1;
+        if ($details->save()){
+            return Json::success('成功!');
+        }else{
+            return Json::fail('失败');
+        }
+
+    }
+
+}

+ 57 - 0
app/admin/model/many/ManyGreen.php

@@ -0,0 +1,57 @@
+<?php
+/**
+ * @author: xaboy<365615158@qq.com>
+ * @day: 2017/11/11
+ */
+
+namespace app\admin\model\many;
+
+use crmeb\traits\ModelTrait;
+use crmeb\basic\BaseModel;
+
+/**
+ * Class StoreCategory
+ * @package app\admin\model\store
+ */
+class ManyGreen extends BaseModel
+{
+
+    /**
+     * 数据表主键
+     * @var string
+     */
+    protected $pk = 'id';
+
+    /**
+     * 模型名称
+     * @var string
+     */
+    protected $name = 'many_green';
+
+    use ModelTrait;
+    protected $autoWriteTimestamp = true;
+
+
+
+    public static function list($where)
+    {
+        $model = self::alias('a')
+            ->field('a.*,b.nickname,b.uid')
+            ->leftJoin('user b', 'a.uid = b.uid');
+
+        if ($where['name'])$model->where('b.nickname|b.uid' , 'like', '%'.$where['name'],'%');
+        if ($where['status'])$model->where('status' , '=', $where['status']);
+        $data['count'] = $model->count();
+        if ($where['page'] && $where['limit']){
+            $model->page($where['page'], $where['limit']);
+        }else{
+            $model->page(20, 1);
+        }
+        $list = $model->select()->toArray();
+        $data['data'] = $list;
+        return $data;
+
+    }
+
+
+}

+ 55 - 0
app/admin/model/user/UserEnter.php

@@ -0,0 +1,55 @@
+<?php
+/**
+ * @author: xaboy<365615158@qq.com>
+ * @day: 2017/11/28
+ */
+
+namespace app\admin\model\user;
+
+use crmeb\traits\ModelTrait;
+use crmeb\basic\BaseModel;
+use crmeb\services\PHPExcelService;
+
+/**
+ * 用户充值记录
+ * Class UserRecharge
+ * @package app\admin\model\user
+ */
+class UserEnter extends BaseModel
+{
+
+    /**
+     * 数据表主键
+     * @var string
+     */
+    protected $pk = 'id';
+
+    /**
+     * 模型名称
+     * @var string
+     */
+    protected $name = 'user_enter';
+
+    use ModelTrait;
+
+
+    public static function list($where)
+    {
+        $model = self::alias('a')
+            ->field('a.*,u.nickname')
+            ->leftJoin('user u', 'u.uid = a.uid');
+
+        if ($where['status'])$model->where('a.status' , '=', $where['status']);
+        $data['count'] = $model->count();
+        if ($where['page'] && $where['limit']){
+            $model->page($where['page'], $where['limit']);
+        }else{
+            $model->page(20, 1);
+        }
+        $list = $model->select()->toArray();
+        $data['data'] = $list;
+        return $data;
+
+    }
+
+}

+ 1 - 1
app/admin/view/index/index.php

@@ -5,7 +5,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="renderer" content="webkit">
     <meta http-equiv="Cache-Control" content="no-siteapp" />
-    <title>CRMEB管理系统</title>
+    <title>喜嗨购管理系统</title>
     <!--[if lt IE 9]>
     <meta http-equiv="refresh" content="0;ie.html" />
     <![endif]-->

+ 188 - 0
app/admin/view/many/many_green/index.php

@@ -0,0 +1,188 @@
+{extend name="public/container"}
+{block name="head_top"}
+
+{/block}
+{block name="content"}
+<style>
+    .btn-outline{
+        border:none;
+    }
+    .btn-outline:hover{
+        background-color: #0e9aef;
+        color: #fff;
+    }
+    .layui-form-item .layui-btn {
+        margin-top: 5px;
+        margin-right: 10px;
+    }
+    .layui-btn-primary{
+        margin-right: 10px;
+        margin-left: 0!important;
+    }
+    label{
+        margin-bottom: 0!important;
+        margin-top: 4px;
+    }
+</style>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15" id="app">
+        <!--搜索条件-->
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">搜索条件</div>
+                <div class="layui-card-body">
+                    <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
+                        <form class="layui-form layui-form-pane" action="">
+                            <div class="layui-form-item">
+
+                                <div class="layui-col-lg12">
+                                    <label class="layui-form-label" style="top: -5.5px;">搜索条件</label>
+                                    <div class="layui-input-inline">
+                                        <input type="text" id="name" name="name" class="layui-input" placeholder="请输入名称">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
+                                    <div class="layui-input-inline">
+                                        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
+                                            <i class="layui-icon layui-icon-search"></i>搜索</button>
+                                    </div>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <!-- 中间详细信息-->
+        <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
+             v-for="item in badge" v-cloak="" v-if="item.count > 0">
+        </div>
+        <!--enb-->
+    </div>
+    <!--列表-->
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">场次列表</div>
+                <div class="layui-card-body">
+
+                    <div class="layui-btn-container" id="container-action">
+                        <a class="layui-btn layui-btn-sm" onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}',{h:500,w:500})">赠送绿卡</a>
+<!--                       <button class="layui-btn layui-btn-sm" data-type="del_auction">批量删除</button>-->
+                    </div>
+                    <table class="layui-hide" id="List" lay-filter="List"></table>
+
+
+                    <script type="text/html" id="image">
+                        <img style="cursor: pointer" lay-event="open_image" src="{{d.image}}">
+                    </script>
+                    <script type="text/html" id="status">
+                        {{#  if(d.status == 0){ }}
+                        <button type="button" name="suc" class="layui-btn layui-btn-xs" id="">
+                            未使用
+                        </button>
+                        {{#  } else if(d.status == 1) { }}
+                        <button type="button" name="suc" class="layui-btn-disabled layui-btn-xs" id="">
+                            已使用
+                        </button>
+                        {{#  } }}
+                    </script>
+                    <script type="text/html" id="type">
+                        {{#  if(d.type == 1){ }}
+                        <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
+                            购买
+                        </button>
+                        {{#  } else if(d.type == 2) { }}
+                        <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
+                            赠送
+                        </button>
+                        {{#  } }}
+                    </script>
+                    <script type="text/html" id="act">
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('编辑','{:Url('next')}?id={{d.id}}',{h:700,w:1100})">
+                            下一期
+                        </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" onclick="$eb.createModalFrame('编辑','{:Url('edit')}?id={{d.id}}',{h:700,w:1100})">
+                            编辑
+                        </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
+                            删除
+                        </button>
+
+                    </script>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--end-->
+</div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name="script"}
+<script>
+    layList.tableList('List', "{:Url('list')}", function () {
+        return [
+            {type: 'checkbox'},
+            {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
+            {field: 'uid', title: 'UID',  align: 'center'},
+            {field: 'nickname', title: '用户昵称', templet: '#name',  align: 'center'},
+            {field: 'type', title: '类型', templet: '#type',  align: 'center'},
+            {field: 'status', title: '使用状态', templet: '#status',  align: 'center'},
+            {field: 'create_time', title: '生成时间', align: 'center'},
+            // {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
+        ];
+    });
+
+    //查询
+    layList.search('search',function(where){
+        layList.reload(where,true);
+    });
+
+    //点击事件绑定
+    layList.tool(function (event,data,obj) {
+        switch (event) {
+            case 'delete':
+                var url=layList.U({c:'many.many',a:'delete',q:{id:data.id}});
+                var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
+                $eb.$swal('delete',function(){
+                    $eb.axios.get(url).then(function(res){
+                        if(res.status == 200 && res.data.code == 200) {
+                            $eb.$swal('success',res.data.msg);
+                            obj.del();
+                            location.reload();
+                        }else
+                            return Promise.reject(res.data.msg || '删除失败')
+                    }).catch(function(err){
+                        $eb.$swal('error',err);
+                    });
+                },code)
+                break;
+            case 'open_image':
+                $eb.openImage(data.image);
+                break;
+            case 'edit':
+                location.href = layList.U({a:'edit',q:{id:data.id}});
+                break;
+        }
+    })
+
+
+    //改状态
+    layList.switch('status',function (odj,value) {
+        if(odj.elem.checked==true){
+            layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }else{
+            layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }
+    });
+</script>
+{/block}

+ 26 - 5
app/admin/view/user/user/index.php

@@ -219,6 +219,20 @@
                         <p style="color:#dab176">{{d.vip_name}}</p>
                         {{# } }}
                     </script>
+                    <script type="text/html" id="effective">
+                        {{# if(d.effective == 1){ }}
+                            有效
+                        {{#  } else if(d.effective == 0) { }}
+                            无效
+                        {{# } }}
+                    </script>
+                    <script type="text/html" id="is_merchant">
+                        {{# if(d.is_merchant == 1){ }}
+                            是
+                        {{#  } else if(d.is_merchant == 0) { }}
+                            否
+                        {{# } }}
+                    </script>
                     <script type="text/html" id="data_time">
                         <p>首次:{{d.add_time}}</p>
                         <p>最近:{{d.last_time}}</p>
@@ -309,15 +323,22 @@
             {field: 'avatar', title: '头像', event:'open_image', width: '6%',align:'center', templet: '<p lay-event="open_image"><img class="avatar" style="cursor: pointer" class="open_image" data-image="{{d.avatar}}" src="{{d.avatar}}" alt="{{d.nickname}}"></p>'},
             {field: 'nickname', title: '姓名',templet:'#nickname',align:'center'},
             {field: 'phone', title: '手机号',align:'center',width:'8%'},
-            {field: 'now_money', title: '余额',width:'6%',sort:true,event:'now_money',align:'center'},
-            {field: 'pay_count', title: '购买次数',align:'center',width:'6%'},
-            {field: 'extract_count_price', title: '累计提现',align:'center',width:'6%'},
-            {field: 'integral', title: '积分',width:'6%',sort:true,event:'integral',align:'center'},
+            {field: 'now_money', title: '余额',sort:true,event:'now_money',align:'center'},
+            {field: 'pay_count', title: '购买次数',align:'center'},
+            {field: 'extract_count_price', title: '累计提现',align:'center'},
+            {field: 'integral', title: '商城积分',sort:true,event:'integral',align:'center'},
+            {field: 'white_integral', title: '白积分',sort:true,event:'white_integral',align:'center'},
+            {field: 'purple_integral', title: '紫积分',sort:true,event:'purple_integral',align:'center'},
+            {field: 'green_integral', title: '绿积分',sort:true,event:'green_integral',align:'center'},
+            {field: 'business_integral', title: '商家积分',sort:true,event:'business_integral',align:'center'},
+            {field: 'paper_ticket', title: '文票',sort:true,event:'paper_ticket',align:'center'},
             {field: 'spread_uid_nickname', title: '推荐人',align:'center'},
             {field: 'sex', title: '性别',width:'4%',align:'center'},
             {field: 'data_time', title: '访问日期',align:'center',width:'12%',templet:'#data_time'},
             // {field: 'status', title: '状态',templet:"#checkboxstatus",width:'6%',align:'center'},
-            {field: 'user_type', title: '用户类型',width:'6%',align:'center'},
+            {field: 'effective', title: '账户状态',templet:"#effective",align:'center'},
+            {field: 'is_merchant', title: '商家状态',templet:"#is_merchant",align:'center'},
+            // {field: 'user_type', title: '用户类型',width:'6%',align:'center'},
             {field: 'operate', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'}
         ];
     });

+ 309 - 0
app/admin/view/user/user_enter/index.php

@@ -0,0 +1,309 @@
+{extend name="public/container"}
+{block name="head_top"}
+
+{/block}
+{block name="content"}
+<style>
+    .btn-outline{
+        border:none;
+    }
+    .btn-outline:hover{
+        background-color: #0e9aef;
+        color: #fff;
+    }
+    .layui-form-item .layui-btn {
+        margin-top: 5px;
+        margin-right: 10px;
+    }
+    .layui-btn-primary{
+        margin-right: 10px;
+        margin-left: 0!important;
+    }
+    label{
+        margin-bottom: 0!important;
+        margin-top: 4px;
+    }
+</style>
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15" id="app">
+        <!--搜索条件-->
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">搜索条件</div>
+                <div class="layui-card-body">
+                    <div class="layui-carousel layadmin-carousel layadmin-shortcut" lay-anim="" lay-indicator="inside" lay-arrow="none" style="background:none">
+                        <form class="layui-form layui-form-pane" action="">
+                            <div class="layui-form-item">
+                                <div class="layui-col-lg12" id="app1">
+                                    <div class="layui-col-lg12">
+                                        <label class="layui-form-label">审核状态:</label>
+                                        <div class="layui-input-block" v-cloak="">
+                                            <button class="layui-btn layui-btn-sm" type="button" v-for="item in statusList"
+                                                    @click="where.status = item.value"
+                                                    :class="{'layui-btn-primary':where.status!==item.value}">{{item.name}}
+                                            </button>
+                                        </div>
+                                    </div>
+                                    <div class="layui-inline">
+                                        <div class="layui-input-inline">
+                                            <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
+                                                <i class="layui-icon layui-icon-search"></i>搜索</button>
+                                        </div>
+                                    </div>
+                                </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <!-- 中间详细信息-->
+        <div :class="item.col!=undefined ? 'layui-col-sm'+item.col+' '+'layui-col-md'+item.col:'layui-col-sm6 layui-col-md3'"
+             v-for="item in badge" v-cloak="" v-if="item.count > 0">
+        </div>
+        <!--enb-->
+    </div>
+    <!--列表-->
+    <div class="layui-row layui-col-space15">
+        <div class="layui-col-md12">
+            <div class="layui-card">
+                <div class="layui-card-header">场次列表</div>
+                <div class="layui-card-body">
+                    <table class="layui-hide" id="List" lay-filter="List"></table>
+
+
+                    <script type="text/html" id="image">
+                        <img style="cursor: pointer" lay-event="open_image" src="{{d.charter}}">
+                    </script>
+                    <script type="text/html" id="status">
+                        {{#  if(d.status == 0){ }}
+                        <button type="button" name="suc" class="layui-btn layui-btn-xs" id="">
+                            待审核
+                        </button>
+                        {{#  } else if(d.status == 1) { }}
+                        <button type="button" name="suc" class="layui-btn-xs layui-btn" id="">
+                            审核通过
+                        </button>
+                        {{#  } else if(d.status < 0) { }}
+                        <button type="button" name="suc" class="layui-btn-xs layui-btn-disabled" id="">
+                            审核未通过
+                        </button>
+                        未通过原因:{{d.fail_message}}
+                        {{#  } }}
+                    </script>
+                    <script type="text/html" id="province">
+                        {{d.province}}-{{d.city}}-{{d.district}}-{{d.address}}
+                    </script>
+                    <script type="text/html" id="act">
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='tg' id="">
+                            通过
+                        </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='jj' id="" onclick="$eb.createModalFrame('编辑','{:Url('jj')}?id={{d.id}}',{h:500,w:500})">
+                            不通过
+                        </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-danger" lay-event='delete' id="">
+                            删除
+                        </button>
+                    </script>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--end-->
+</div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name="script"}
+<script>
+    layList.form.render();
+    layList.tableList('List', "{:Url('list')}", function () {
+        return [
+            {type: 'checkbox'},
+            {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%', templet: '#id'},
+            {field: 'nickname', title: '申请用户',  align: 'center'},
+            {field: 'merchant_name', title: '商户名称',  align: 'center'},
+            {field: 'link_user', title: '商户姓名',  align: 'center'},
+            {field: 'link_tel', title: '商户电话',  align: 'center'},
+            {field: 'charter', title: '商户证书',  align: 'center',templet: '#image'},
+            {field: 'province', title: '商户地址', align: 'center',templet: '#province'},
+            {field: 'status', title: '状态', templet: '#status', align: 'center'},
+            {field: 'add_time', title: '申请时间', align: 'center',width: '8%'},
+            {field: 'right', title: '操作', align: 'center', toolbar: '#act',width: '15%'},
+        ];
+    });
+
+    //查询
+    layList.search('search',function(where){
+        layList.reload(where,true);
+    });
+
+    //点击事件绑定
+    layList.tool(function (event,data,obj) {
+        switch (event) {
+            case 'delete':
+                var url=layList.U({c:'user.user_enter',a:'delete',q:{id:data.id}});
+                var code = {title:"操作提示",text:"确定将该商品移入回收站吗?",type:'info',confirm:'是的,移入回收站'};
+                $eb.$swal('delete',function(){
+                    $eb.axios.get(url).then(function(res){
+                        if(res.status == 200 && res.data.code == 200) {
+                            $eb.$swal('success',res.data.msg);
+                            obj.del();
+                            location.reload();
+                        }else
+                            return Promise.reject(res.data.msg || '删除失败')
+                    }).catch(function(err){
+                        $eb.$swal('error',err);
+                    });
+                },code)
+                break;
+            case 'tg':
+                var url=layList.U({c:'user.user_enter',a:'tg',q:{id:data.id}});
+                var code = {title:"操作提示",text:"确定审核通过?",type:'info',confirm:'是的'};
+                $eb.$swal('delete',function(){
+                    $eb.axios.get(url).then(function(res){
+                        if(res.status == 200 && res.data.code == 200) {
+                            $eb.$swal('success',res.data.msg);
+                            location.reload();
+                        }else
+                            return Promise.reject(res.data.msg || '删除失败')
+                    }).catch(function(err){
+                        $eb.$swal('error',err);
+                    });
+                },code)
+                break;
+            case 'open_image':
+                $eb.openImage(data.charter);
+                break;
+            case 'edit':
+                location.href = layList.U({a:'edit',q:{id:data.id}});
+                break;
+        }
+    })
+
+
+    //改状态
+    layList.switch('status',function (odj,value) {
+        if(odj.elem.checked==true){
+            layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:1,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }else{
+            layList.baseGet(layList.Url({c:'auction.auction',a:'set_status',p:{status:0,id:value}}),function (res) {
+                layList.msg(res.msg, function () {
+                    layList.reload();
+                });
+            });
+        }
+    });
+
+    require(['vue'], function (Vue) {
+        new Vue({
+            el: "#app1",
+            data: {
+                badge: [],
+                dataList: [
+                    {name: '全部', value: ''},
+                    {name: '今天', value: 'today'},
+                    {name: '昨天', value: 'yesterday'},
+                    {name: '最近7天', value: 'lately7'},
+                    {name: '最近30天', value: 'lately30'},
+                    {name: '本月', value: 'month'},
+                    {name: '本年', value: 'year'},
+                ],
+                statusList:[
+                    {name: '全部', value: ''},
+                    {name: '待审核', value: '0'},
+                    {name: '审核通过', value: '1'},
+                    {name: '审核未通过', value: '-1'}
+                ],
+                where: {
+                    data: '',
+                    status: status,
+                    type: '',
+                    pay_type: '',
+                    excel: 0,
+                },
+                showtime: false,
+            },
+            watch: {
+                'where.status': function () {
+                    this.where.excel = 0;
+                    this.getBadge();
+                    layList.reload(this.where, true);
+                },
+                'where.data': function () {
+                    this.where.excel = 0;
+                    this.getBadge();
+                    layList.reload(this.where, true);
+                },
+                'where.type': function () {
+                    this.where.excel = 0;
+                    this.getBadge();
+                    layList.reload(this.where, true);
+                },
+                'where.pay_type': function () {
+                    this.where.excel = 0;
+                    this.getBadge();
+                    layList.reload(this.where, true);
+                }
+            },
+            methods: {
+                setData: function (item) {
+                    var that = this;
+                    if (item.is_zd == true) {
+                        that.showtime = true;
+                        this.where.data = this.$refs.date_time.innerText;
+                    } else {
+                        this.showtime = false;
+                        this.where.data = item.value;
+                    }
+                },
+                getBadge: function () {
+                    var that = this;
+                    layList.basePost(layList.Url({c: 'order.store_order', a: 'getBadge'}), this.where, function (rem) {
+                        that.badge = rem.data;
+                    });
+                },
+                search: function () {
+                    this.where.excel = 0;
+                    this.getBadge();
+                    layList.reload(this.where, true);
+                },
+                refresh: function () {
+                    layList.reload();
+                    this.getBadge();
+                },
+                excel: function () {
+                    var name = $('#name').val();
+                    var many_id = $('#many_id').val();
+                    var order_id = $('#order_id').val();
+                    var stage = $('#stage').val();
+                    this.where['name'] = name;
+                    this.where['many_id'] = many_id;
+                    this.where['order_id'] = order_id;
+                    this.where['stage'] = stage;
+                    this.where.excel = 1;
+                    location.href = layList.U({c: 'many.many_order', a: 'list', q: this.where});
+                    this.where.excel = 0;
+                }
+            },
+            mounted: function () {
+                var that = this;
+                that.getBadge();
+                window.formReload = this.search;
+                layList.laydate.render({
+                    elem: this.$refs.date_time,
+                    trigger: 'click',
+                    eventElem: this.$refs.time,
+                    range: true,
+                    change: function (value) {
+                        that.where.data = value;
+                    }
+                });
+            }
+        })
+    });
+</script>
+{/block}