diff --git a/app/admin/controller/user/User.php b/app/admin/controller/user/User.php index 91dcf78b..b3617e57 100755 --- a/app/admin/controller/user/User.php +++ b/app/admin/controller/user/User.php @@ -11,6 +11,7 @@ use app\common\enum\ClientEnum; use app\common\model\user\UserLevel; use app\common\server\JsonServer; use think\exception\ValidateException; +use think\facade\Db; class User extends AdminBase { @@ -192,4 +193,26 @@ class User extends AdminBase 'info' => $detail, ]); } + + public function real() + { + $id = $this->request->get('id/d'); + $res = Db::name('user_real')->where('user_id', $id)->find(); + + if ($this->request->isAjax()) { + $post = $this->request->post(); + if ($post['huifu_id']) { + Db::name('user_real')->where('user_id', $post['id'])->update([ + 'huifu_id' => $post['huifu_id'], + 'state' => 1, + ]); + return JsonServer::success('审核成功'); + } + } + + return view('', [ + 'info' => $res, + 'user_id' => $id + ]); + } } \ No newline at end of file diff --git a/app/admin/view/user/user/lists.html b/app/admin/view/user/user/lists.html index dab886e8..aa1c5b2e 100755 --- a/app/admin/view/user/user/lists.html +++ b/app/admin/view/user/user/lists.html @@ -182,6 +182,7 @@ 等级调整 推荐人调整 支出明细 + 实名认证 @@ -395,7 +396,7 @@ ,{title: '上级推荐人',width: 90,align: 'center',width: 350, templet: '#first-info'} ,{field: 'fans', title: '推荐下级人数',width: 120,align: 'center'} ,{title: '注册信息',width: 300,align: 'center', templet: '#register-info'} - ,{fixed: 'right', title: '操作', width: 500,toolbar: '#user-operation',align: 'center'} + ,{fixed: 'right', title: '操作', width: 600,toolbar: '#user-operation',align: 'center'} ]] ,page:true ,text: {none: '暂无数据!'} @@ -656,6 +657,50 @@ } }) } + + if(obj.event === 'real') { + var id = obj.data.id; + layer.open({ + type: 2 + ,title: '实名认证' + ,content: '{:url("user.user/real")}?id='+id + ,area: ['90%', '90%'] + ,btn: ['审核', '取消'] + ,yes: function(index, layero){ + var iframeWindow = window['layui-layer-iframe'+ index] + ,submit = layero.find('iframe').contents().find('#formSubmit'); + //监听提交 + iframeWindow.layui.form.on('submit(formSubmit)', function(data){ + var field = data.field; + $.ajax({ + url:'{:url("user.user/real")}', + data:field, + type:"post", + success:function(res) + { + if(res.code == 1) + { + layui.layer.msg(res.msg, { + offset: '15px' + , icon: 1 + , time: 1000 + }); + layer.close(index); //关闭弹层 + table.reload('user-lists'); //数据刷新 + }else{ + layer.msg(res.msg, { + offset: '15px' + , icon: 2 + , time: 1000 + }); + } + } + }); + }); + submit.trigger('click'); + } + }) + } }); }); diff --git a/app/admin/view/user/user/real.html b/app/admin/view/user/user/real.html new file mode 100755 index 00000000..93980e60 --- /dev/null +++ b/app/admin/view/user/user/real.html @@ -0,0 +1,67 @@ +{layout name="layout2" /} + +