更新
This commit is contained in:
parent
7f305fb6d2
commit
438e1f8983
@ -16,6 +16,7 @@ namespace app\api\logic;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\AppUpdate;
|
||||||
use app\common\model\article\Article;
|
use app\common\model\article\Article;
|
||||||
use app\common\model\decorate\DecoratePage;
|
use app\common\model\decorate\DecoratePage;
|
||||||
use app\common\model\decorate\DecorateTabbar;
|
use app\common\model\decorate\DecorateTabbar;
|
||||||
@ -24,7 +25,6 @@ use app\common\model\user\UserRole;
|
|||||||
use app\common\service\ConfigService;
|
use app\common\service\ConfigService;
|
||||||
use app\common\service\FileService;
|
use app\common\service\FileService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* index
|
* index
|
||||||
* Class IndexLogic
|
* Class IndexLogic
|
||||||
@ -155,6 +155,15 @@ class IndexLogic extends BaseLogic
|
|||||||
'shop_logo' => FileService::getFileUrl(ConfigService::get('website', 'shop_logo')),
|
'shop_logo' => FileService::getFileUrl(ConfigService::get('website', 'shop_logo')),
|
||||||
];
|
];
|
||||||
$versionInfo = [];
|
$versionInfo = [];
|
||||||
|
$version='1.0.0';
|
||||||
|
if(self::isAndroid()){
|
||||||
|
$versionInfo=AppUpdate::where('type',2)->order('id','desc')->find();
|
||||||
|
}elseif(self::isIOS()){
|
||||||
|
$versionInfo=AppUpdate::where('type',1)->order('id','desc')->find();
|
||||||
|
}
|
||||||
|
if($versionInfo){
|
||||||
|
$version=$versionInfo['version'];
|
||||||
|
}
|
||||||
return [
|
return [
|
||||||
'domain' => FileService::getFileUrl(),
|
'domain' => FileService::getFileUrl(),
|
||||||
'style' => $style,
|
'style' => $style,
|
||||||
@ -162,19 +171,20 @@ class IndexLogic extends BaseLogic
|
|||||||
'menu' => $menu,
|
'menu' => $menu,
|
||||||
'login' => $loginConfig,
|
'login' => $loginConfig,
|
||||||
'website' => $website,
|
'website' => $website,
|
||||||
'version'=> config('project.version'),
|
'version' => $version,
|
||||||
'version_info' => $versionInfo,
|
'version_info' => $versionInfo,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function isAndroid() {
|
public static function isAndroid()
|
||||||
|
{
|
||||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||||
return strpos($userAgent, 'Android') !== false;
|
return strpos($userAgent, 'Android') !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isIOS() {
|
public static function isIOS()
|
||||||
|
{
|
||||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||||
return strpos($userAgent, 'iPhone') !== false || strpos($userAgent, 'iPad') !== false;
|
return strpos($userAgent, 'iPhone') !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user