From d7c3bc90ea0d8ccfea34ae76709b5ef4e9613cbd Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 28 Nov 2024 11:53:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Ajax.php | 8 ++++---- application/common/model/User.php | 4 ++++ public/assets/js/backend/user/user.js | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index 1e34d85d..32748b01 100644 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -175,18 +175,18 @@ class Ajax extends Backend $weighdata[$v[$prikey]] = $v[$field]; } $position = array_search($changeid, $ids); - $desc_id = isset($sour[$position]) ? $sour[$position] : end($sour); //移动到目标的ID值,取出所处改变前位置的值 + $desc_id = $sour[$position] ?? end($sour); //移动到目标的ID值,取出所处改变前位置的值 $sour_id = $changeid; - $weighids = array(); + $weighids = []; $temp = array_values(array_diff_assoc($ids, $sour)); foreach ($temp as $m => $n) { if ($n == $sour_id) { $offset = $desc_id; } else { if ($sour_id == $temp[0]) { - $offset = isset($temp[$m + 1]) ? $temp[$m + 1] : $sour_id; + $offset = $temp[$m + 1] ?? $sour_id; } else { - $offset = isset($temp[$m - 1]) ? $temp[$m - 1] : $sour_id; + $offset = $temp[$m - 1] ?? $sour_id; } } if (!isset($weighdata[$offset])) { diff --git a/application/common/model/User.php b/application/common/model/User.php index 097ed4ae..b4f51ff3 100644 --- a/application/common/model/User.php +++ b/application/common/model/User.php @@ -7,6 +7,10 @@ use think\Model; /** * 会员模型 + * @method static mixed getByUsername($str) 通过用户名查询用户 + * @method static mixed getByNickname($str) 通过昵称查询用户 + * @method static mixed getByMobile($str) 通过手机查询用户 + * @method static mixed getByEmail($str) 通过邮箱查询用户 */ class User extends Model { diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js index 6ecd5181..1ee1a74f 100644 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -21,6 +21,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'user.id', + fixedColumns: true, + fixedRightNumber: 1, columns: [ [ {checkbox: true},