Kirin 4 gadi atpakaļ
vecāks
revīzija
d219f749c4

+ 22 - 1
app/admin/controller/user/User.php

@@ -8,6 +8,7 @@
 namespace app\admin\controller\user;
 namespace app\admin\controller\user;
 
 
 use app\admin\controller\AuthController;
 use app\admin\controller\AuthController;
+use app\models\member\MemberCheck;
 use crmeb\repositories\UserRepository;
 use crmeb\repositories\UserRepository;
 use crmeb\traits\CurdControllerTrait;
 use crmeb\traits\CurdControllerTrait;
 use think\facade\Route as Url;
 use think\facade\Route as Url;
@@ -70,7 +71,7 @@ class User extends AuthController
         list($group_id) = Util::postMore([
         list($group_id) = Util::postMore([
             ['group_id', 0],
             ['group_id', 0],
         ], $this->request, true);
         ], $this->request, true);
-        $uids = explode(',',$uid);
+        $uids = explode(',', $uid);
         $res = UserModel::whereIn('uid', $uids)->update(['group_id' => $group_id]);
         $res = UserModel::whereIn('uid', $uids)->update(['group_id' => $group_id]);
         if ($res) {
         if ($res) {
             return Json::successful('设置成功');
             return Json::successful('设置成功');
@@ -793,4 +794,24 @@ class User extends AuthController
     {
     {
         return Json::successful(UserBillAdmin::getOneBalanceChangList(compact('uid', 'page', 'limit')));
         return Json::successful(UserBillAdmin::getOneBalanceChangList(compact('uid', 'page', 'limit')));
     }
     }
+
+
+    public function member()
+    {
+        return $this->fetch();
+    }
+
+    /**
+     * 投票列表
+     */
+    public function memberList()
+    {
+        $where = Util::getMore([
+            ['page', 1],
+            ['limit', 20],
+            ['search', '']
+        ]);
+        $where['paid'] = 1;
+        Json::successlayui(MemberCheck::getList($where));
+    }
 }
 }

+ 108 - 0
app/admin/view/user/user/member.php

@@ -0,0 +1,108 @@
+{extend name="public/container"}
+{block name="head_top"}
+
+{/block}
+{block name="content"}
+<div class="layui-fluid" style="background: #fff;margin-top: -10px;">
+    <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="address">
+                        {{d.province}} {{d.city}} {{d.area}},{{d.detail_address}}
+                    </script>
+                    <script type="text/html" id="logo">
+                        <p lay-event="open_image">
+                            <img class="avatar open_image" style="cursor: pointer" data-image="{{d.logo}}"
+                                 src="{{d.logo}}">
+                        </p>
+                    </script>
+                    <script type="text/html" id="job">
+
+                    </script>
+                    <script type="text/html" id="act">
+                        {{# if(d.status == 0){ }}
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='pass'>
+                            通过
+                        </button>
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='cancel'>
+                            驳回
+                        </button>
+                        {{# } }}
+                        {{# if(d.status == 1){ }}
+                        <button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event='see'>
+                            查看证书
+                        </button>
+                        {{# } }}
+                    </script>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="{__ADMIN_PATH}js/layuiList.js"></script>
+{/block}
+{block name="script"}
+<script>
+    layList.tableList('List', "{:Url('groupList')}", function () {
+        return [
+            {field: 'id', title: 'ID', sort: true, event: 'id', width: '5%'},
+            {field: 'name', title: '姓名/企业名', width: '10%'},
+            {field: 'logo', toolbar: '#logo', title: '半身照/LOGO', width: '8%'},
+            {field: '_type', title: '类型', width: '8%'},
+            {field: 'idcard', title: '身份证号/企业统一代码', width: '12%'},
+            {field: 'phone', title: '联系方式', width: '8%'},
+            {field: 'address', toolbar: '#address', title: '地址', width: '15%'},
+            {field: 'job', toolbar: '#job', title: '职业/主营业务', width: '12%'},
+            {field: 'grade_name', title: '申请类型', width: '8%'},
+            {field: 'pay_money', title: '支付金额', width: '5%'},
+            {field: 'status_txt', title: '状态', width: '5%'},
+            {field: 'right', title: '操作', align: 'center', toolbar: '#act'},
+        ];
+    });
+    //点击事件绑定
+    layList.tool(function (event, data, obj) {
+        switch (event) {
+            case 'pass':
+                var url = layList.U({c: 'user.user', a: 'pass', 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 'cancel':
+                var url = layList.U({c: 'user.user', a: 'cancel', 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 'see':
+                break;
+            case 'open_image':
+                $eb.openImage(data.image);
+                break;
+        }
+    })
+</script>
+{/block}

+ 23 - 0
app/models/member/MemberCheck.php

@@ -61,6 +61,29 @@ class MemberCheck extends BaseModel
         return compact('count', 'data');
         return compact('count', 'data');
     }
     }
 
 
+    /**
+     * @param $where
+     * @return array
+     */
+    public static function getList($where)
+    {
+        $model = self::where('paid', $where['paid']);
+        if (isset($where['search']) && $where['search'] != '') $model = $model->where('name|iacard', "%{$where['search']}%");
+        $data = $model->page((int)$where['page'], (int)$where['limit'])->order('add_time', 'desc')->select()->each(function ($item) {
+            $item['_add_time'] = date('Y-m-d H:i:s', $item['add_time']);
+            $item['_valid_time'] = date('Y-m-d H:i:s', $item['valid_time']);
+            $item['_pay_time'] = date('Y-m-d H:i:s', $item['pay_time']);
+            $item['_pay_time'] = date('Y-m-d H:i:s', $item['pay_time']);
+            $item['_type'] = $item['type'] == 1 ? "个人会员" : "企业会员";
+            $item['grade_info'] = MemberGrade::where('grade=' . $item['grade'])->where('type=' . $item['type'])->find();
+            $item['grade_name'] = $item['grade_info']['name'];
+            $item['status_txt'] = ($item['status'] == 0 ? "待审核" : ($item['status'] == 1 ? "通过" : "驳回"));
+            if ($item['status'] == 1) $item['status_txt'] .= '<br/>有效期至:<br/>' . date('Y-m-d', $item['valid_time']);
+        });
+        $count = $model->count();
+        return compact('count', 'data');
+    }
+
     public static function createOrder($param, $uid, $pay_type, $from)
     public static function createOrder($param, $uid, $pay_type, $from)
     {
     {
         $type = $param['type'] ?? '';
         $type = $param['type'] ?? '';