mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
优化查询代码;增加RSS1
This commit is contained in:
45
app/common/tools/Site.php
Normal file
45
app/common/tools/Site.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace app\common\tools;
|
||||
|
||||
use think\facade\Request;
|
||||
|
||||
class Site
|
||||
{
|
||||
public static function mapAllPost()
|
||||
{
|
||||
$list_post = \app\model\Post::cache(60)->where('status', 1)->select();
|
||||
|
||||
return $list_post;
|
||||
}
|
||||
public static function mapRecentlyPost()
|
||||
{
|
||||
$list_post = \app\model\Post::cache(60)->where('status', 1)->order('publish_time', "desc")->limit(25)->select();
|
||||
|
||||
return $list_post;
|
||||
}
|
||||
|
||||
public static function name()
|
||||
{
|
||||
return get_system_config('site_name');
|
||||
}
|
||||
|
||||
public static function indexUrl()
|
||||
{
|
||||
return Request::scheme() . '://' . get_system_config('main_domain', Request::host());
|
||||
}
|
||||
|
||||
public static function desc()
|
||||
{
|
||||
return get_system_config('site_desc');
|
||||
}
|
||||
|
||||
public static function logo()
|
||||
{
|
||||
return get_source_link(get_system_config('site_logo'));
|
||||
}
|
||||
|
||||
public static function keywords()
|
||||
{
|
||||
return get_system_config('site_keywords');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user