60 lines
1.8 KiB
PHP
Executable File
60 lines
1.8 KiB
PHP
Executable File
<?php
|
|
namespace app\model;
|
|
|
|
use think\facade\Config as CConfig;
|
|
|
|
class System extends Base
|
|
{
|
|
//获取友情链接上传图片尺寸
|
|
public static function getLinkImageSize()
|
|
{
|
|
$system = self::getSystem();
|
|
if(!empty($system['link_w']) && !empty($system['link_h'])){
|
|
$linkSize = $system['link_w'] . '像素 X ' . $system['link_h'] . '像素';
|
|
}else{
|
|
$linkSize = '';
|
|
}
|
|
return $linkSize;
|
|
}
|
|
//获取幻灯片上传尺寸
|
|
public static function getSlideImageSize()
|
|
{
|
|
$system = self::getSystem();
|
|
if(!empty($system['slide_w']) && !empty($system['slide_h'])){
|
|
$slideSize = $system['slide_w'] . '像素 X ' . $system['slide_h'] . '像素';
|
|
}else{
|
|
$slideSize = '';
|
|
}
|
|
if(!empty($system['slide_mobile_w']) && !empty($system['slide_mobile_h'])){
|
|
$slideMobileSize = $system['slide_mobile_w'] . '像素 X ' . $system['slide_mobile_h'] . '像素';
|
|
}else{
|
|
$slideMobileSize = '';
|
|
}
|
|
return [
|
|
'slide_size' => $slideSize,
|
|
'slide_mobile_size' => $slideMobileSize
|
|
];
|
|
}
|
|
//获取文章图片尺寸
|
|
public static function getArticleImageSize()
|
|
{
|
|
$system = self::getSystem();
|
|
if(!empty($system['article_w']) && !empty($system['article_h'])){
|
|
$articleSize = $system['article_w'] . '像素 X ' . $system['article_h'] . '像素';
|
|
}else{
|
|
$articleSize = '';
|
|
}
|
|
return $articleSize;
|
|
}
|
|
//获取系统配置信息
|
|
public static function getSystem()
|
|
{
|
|
$system = self::order('id asc')
|
|
->findOrEmpty()
|
|
->toArray();
|
|
CConfig::load('extra/base', "extraBase");
|
|
$extraBase = config("extraBase");
|
|
return array_merge($extraBase,$system);
|
|
}
|
|
}
|