From 686681ca6f898a61be81b58bba4d130d034f0c60 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Sat, 23 Apr 2022 14:42:59 +0800 Subject: [PATCH] =?UTF-8?q?js=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96=E3=80=81=E7=94=A8=E6=88=B7=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=B1=BB=E5=9E=8B=E7=BC=96=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/default/user/save_info.html | 2 +- app/service/UserService.php | 5 ++-- public/static/common/js/common.js | 27 ++++++++++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/admin/view/default/user/save_info.html b/app/admin/view/default/user/save_info.html index 09c2c1228..0d30ceb01 100755 --- a/app/admin/view/default/user/save_info.html +++ b/app/admin/view/default/user/save_info.html @@ -11,7 +11,7 @@
- +
diff --git a/app/service/UserService.php b/app/service/UserService.php index 3e0485e91..4a7eb1f53 100755 --- a/app/service/UserService.php +++ b/app/service/UserService.php @@ -357,7 +357,7 @@ class UserService // 更新数据 $data = [ - 'system_type' => empty($params['system_type']) ? 'default' : $params['system_type'], + 'system_type' => empty($params['system_type_name']) ? 'default' : $params['system_type_name'], 'username' => isset($params['username']) ? $params['username'] : '', 'nickname' => isset($params['nickname']) ? $params['nickname'] : '', 'mobile' => isset($params['mobile']) ? $params['mobile'] : '', @@ -404,12 +404,11 @@ class UserService if(!empty($params['id'])) { // 获取用户信息 - $user = self::UserInfo('id', intval($params['id']), 'id,integral'); + $user = Db::name('User')->where(['id'=>intval($params['id'])])->field('id,integral')->find(); if(empty($user)) { return DataReturn('用户信息不存在', -10); } - $ret = self::UserUpdateHandle($data, $params['id']); if($ret['code'] == 0) { diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index eda00f543..a5ea675d3 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -307,18 +307,25 @@ function FromInit(form_name) onInValid: function(validity) { var $this = this; - setTimeout(function() + var $field = $(validity.field); + var tag_name = $field.prop('tagName'); + if(tag_name == 'SELECT') { - - // 错误信息 - var $field = $(validity.field); - var value = $field.val(); - var msg = $field.data('validationMessage') || $this.getValidationMessage(validity); - if((value == '' || value == undefined) && $field.hasClass('am-field-error')) + setTimeout(function() { - Prompt(msg); - } - }, 100); + // 错误信息 + var $field = $(validity.field); + var value = $field.val(); + var msg = $field.data('validationMessage') || $this.getValidationMessage(validity); + if((value == '' || value == undefined) && $field.hasClass('am-field-error')) + { + Prompt(msg); + } + }, 100); + } else { + var msg = $field.data('validationMessage') || $this.getValidationMessage(validity); + Prompt(msg); + } }, // 提交 -- GitLab