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