From 3e1eafbe900d03f590f1c9d279ef281471654660 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 11 Apr 2024 15:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=A4=9A=E6=8F=90?= =?UTF-8?q?=E8=B4=A7=E7=82=B9=E6=A8=A1=E5=BC=8F=20-=20=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=8F=90=E8=B4=A7=E7=82=B9=E6=97=B6=20?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/PointRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/store/PointRepository.php b/app/common/repositories/store/PointRepository.php index a40f0db..c150052 100644 --- a/app/common/repositories/store/PointRepository.php +++ b/app/common/repositories/store/PointRepository.php @@ -89,7 +89,8 @@ class PointRepository extends BaseRepository{ */ public function getUseInfo(int $useId = 0):array{ $list = $this->getSearchModel([])->withoutField('create_time,update_time')->select()->toArray(); - $config = $useId > 0 ? (array_column($list, null, 'id')[$useId] ?? []) : []; + if(count($list) == 1) $config = $list[0] ?? []; + else $config = $useId > 0 ? (array_column($list, null, 'id')[$useId] ?? []) : []; return compact('list', 'config'); }