54 lines
1.6 KiB
PHP
54 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace addons\webman\model;
|
|
|
|
use addons\webman\traits\HasDateTimeFormatter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* Class AppVersion
|
|
* @property int id 主键
|
|
* @property int department_id 所属部门/渠道
|
|
* @property string system_key 系统标识
|
|
* @property string app_version 版本号
|
|
* @property string app_version_key 版本标识
|
|
* @property string apk_url 安装包地址
|
|
* @property string force_update 强制更新 1强制 0不强制
|
|
* @property string hot_update 热更新 0 热更新 1 整包更新
|
|
* @property string regular_update 定时更新
|
|
* @property string update_content 更新内容
|
|
* @property string notes 操作备注
|
|
* @property int status 状态
|
|
* @property int user_id 管理员id
|
|
* @property string user_name 管理员名称
|
|
* @property string created_at 创建时间
|
|
* @property string updated_at 最后一次修改时间
|
|
*
|
|
* @property AdminDepartment department
|
|
* @property AdminUser user
|
|
* @package addons\webman\model
|
|
*/
|
|
class AppVersion extends Model
|
|
{
|
|
use HasDateTimeFormatter;
|
|
|
|
const SYSTEM_KEY_ANDROID = 'android'; // 安卓
|
|
const SYSTEM_KEY_IOS = 'ios'; // 苹果
|
|
|
|
public function __construct(array $attributes = [])
|
|
{
|
|
parent::__construct($attributes);
|
|
$this->setTable(plugin()->webman->config('database.app_version_table'));
|
|
}
|
|
|
|
/**
|
|
* 渠道信息
|
|
* @return BelongsTo
|
|
*/
|
|
public function channel(): BelongsTo
|
|
{
|
|
return $this->belongsTo(plugin()->webman->config('database.channel_model'), 'department_id', 'department_id')->withTrashed();
|
|
}
|
|
}
|