|
@@ -38,12 +38,21 @@ class SiteCache
|
|
|
|
|
|
if (!empty($dist['appearance_id']))
|
|
if (!empty($dist['appearance_id']))
|
|
{
|
|
{
|
|
- $dist['appearance'] = DistAppearance::getTemplateById($dist['appearance_id']);
|
|
|
|
- $dist['publishList'] = DistAppearancePublishList::findByDistAndAppearance($dist['id'], $dist['appearance_id']);
|
|
|
|
- $dist['template_name'] = $dist['appearance']['title'];
|
|
|
|
|
|
+ $appearance = DistAppearance::getTemplateById($dist['appearance_id']);
|
|
|
|
+ $publishList = DistAppearancePublishList::findByDistAndAppearance($dist['id'], $dist['appearance_id']);
|
|
|
|
+
|
|
|
|
+ if ($appearance && $publishList) {
|
|
|
|
+ $dist['appearance'] = $appearance;
|
|
|
|
+ $dist['publishList'] = $publishList;
|
|
|
|
+ $dist['template_name'] = $appearance['title'];
|
|
|
|
+ } else {
|
|
|
|
+ return null; // 如果 appearance 或 publishList 加载失败,返回 null
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
// 序列化存储
|
|
// 序列化存储
|
|
return serialize($dist);
|
|
return serialize($dist);
|