no message

This commit is contained in:
hajimi
2026-06-11 12:15:29 +08:00
parent 10ebe39c30
commit 96efa1d905
5859 changed files with 815501 additions and 5 deletions
@@ -0,0 +1,62 @@
<?php
namespace app\common\model\app;
use app\common\model\BaseModel;
use app\common\service\FileService;
use think\model\concern\SoftDelete;
/**
* APP 版本管理模型
* Class AppVersion
* @package app\common\model\app
*/
class AppVersion extends BaseModel
{
use SoftDelete;
protected $name = 'app_version';
protected $deleteTime = 'delete_time';
/**
* 平台名称
*/
public function getPlatformTextAttr($value, $data): string
{
$map = [1 => 'Android', 2 => 'iOS'];
return $map[$data['platform']] ?? '';
}
/**
* 包类型名称
*/
public function getPackageTypeTextAttr($value, $data): string
{
$map = [1 => 'wgt热更', 2 => 'apk整包', 3 => 'ipa/AppStore'];
return $map[$data['package_type']] ?? '';
}
/**
* 升级类型名称
*/
public function getUpdateTypeTextAttr($value, $data): string
{
$map = [1 => '普通升级', 2 => '强制升级', 3 => '静默升级'];
return $map[$data['update_type']] ?? '';
}
/**
* 完整下载链接
*/
public function getDownloadUrlAttr($value): string
{
if (empty($value)) {
return '';
}
// 已是完整 URLhttp/https)直接返回
if (preg_match('/^https?:\/\//i', $value)) {
return $value;
}
return FileService::getFileUrl($value);
}
}