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'); }