From 593e7d6ea9d326fcf90cc9a73170ef106abc5e34 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Tue, 11 Feb 2025 14:24:48 +0800 Subject: [PATCH] feat: site --- app/Model/Site.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Model/Site.php b/app/Model/Site.php index 4be5895..2d2ef99 100644 --- a/app/Model/Site.php +++ b/app/Model/Site.php @@ -98,13 +98,17 @@ class Site extends Model } /** - * @return Builder[]|Collection + * @return array */ - public function getAllSiteList(): Collection|array + public function getAllSiteList(): array { - return $this + $res = $this ->where('is_del',SiteCode::SITE_NO_DEL) ->where('status',SiteCode::SITE_ENABLE) ->get(['id','name','kitchen_id','city_id','address','lng','lat']); + + if (empty($res)) return []; + + return $res->toArray(); } }