Browse Source

清空用户手机号+实名信息

lizhen_gitee 10 tháng trước cách đây
mục cha
commit
d857e6e6c8

+ 21 - 0
application/admin/controller/user/User.php

@@ -145,5 +145,26 @@ class User extends Backend
         $this->assign('row',$info);
         return $this->view->fetch();
     }
+    /**
+     * 清空手机号+身份证
+     */
+    public function cleanmobile(){
+
+        if ($this->request->isAjax()) {
+
+            $user_id = input('id');
+
+            $userinfo = Db::name('user')->where('id',$user_id)->find();
+            if($userinfo['status'] != '-1'){
+                $this->error('请先将用户注销');
+            }
+
+            Db::name('user')->where('id',$user_id)->update(['mobile'=>'']);
+            Db::name('user_idconfirm')->where('user_id',$user_id)->delete();
+
+            $this->success('已清空');
+        }
+
+    }
 
 }

+ 1 - 2
application/admin/view/user/user/edit.html

@@ -354,7 +354,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Jinyantime')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-jinyantime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[jinyantime]" type="text" value="{:$row.jinyantime?datetime($row.jinyantime):''}">
+            <input id="c-jinyantime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[jinyantime]" type="text" value="{:$row.jinyantime?datetime($row.jinyantime):''}">
         </div>
     </div>
     <!--<div class="form-group">
@@ -373,7 +373,6 @@
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">
             <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
-            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
         </div>
     </div>
 </form>

+ 1 - 0
application/admin/view/user/user/index.html

@@ -37,6 +37,7 @@
                            data-operate-del="{:$auth->check('user/user/del')}"
                            data-operate-updatemoney="{:$auth->check('user/user/updatemoney')}"
                            data-operate-updatejewel="{:$auth->check('user/user/updatejewel')}"
+                           data-operate-cleanmobile="{:$auth->check('user/user/cleanmobile')}"
                            width="100%">
                     </table>
                 </div>

+ 14 - 0
public/assets/js/backend/user/user.js

@@ -97,6 +97,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     url:'user/user/updatejewel/id/{ids}?dialog=1',
                                     target:'_self',
                                 },
+                                {
+                                    name:'cleanmobile',
+                                    text:'清空手机号+身份证',
+                                    title:'清空手机号+身份证',
+                                    confirm:'清空手机号之后用户将无法登录,也无法找回',
+                                    icon:'fa fa-exclamation-circle',
+                                    classname:'btn btn-xs btn-info btn-ajax',
+                                    url:'user/user/cleanmobile/id/{ids}?dialog=1',
+                                    target:'_self',
+                                    refresh:true,
+                                },
                                 /* {
                                  name:'updatevip',
                                  text:'充值vip会员',
@@ -127,6 +138,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         updatejewel: function () {
             Controller.api.bindevent();
         },
+        cleanmobile: function () {
+            Controller.api.bindevent();
+        },
         api: {
             bindevent: function () {
                 Form.api.bindevent($("form[role=form]"));