feat : site
This commit is contained in:
@@ -50,14 +50,15 @@ class SiteService extends BaseService
|
|||||||
*/
|
*/
|
||||||
public function handle(): array
|
public function handle(): array
|
||||||
{
|
{
|
||||||
$siteIds = $this->userSiteModel->where('user_id', $this->userId)->pluck('site_id')->toArray();
|
$siteIds = $this->userSiteModel->where('user_id', $this->userId)->select(['id','is_default'])->get();
|
||||||
|
|
||||||
$res = [];
|
if (empty($siteIds)) $this->return->success('success', ['list' => []]);
|
||||||
foreach ($siteIds as $siteId) {
|
|
||||||
$res[] = $this->siteCache->getSiteInfo($siteId);
|
foreach ($siteIds as &$siteId) {
|
||||||
|
$siteId = array_merge($siteId,$this->siteCache->getSiteInfo($siteId['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->return->success('success', ['list' => $res]);
|
return $this->return->success('success', ['list' => $siteIds]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user