40 lines
800 B
PHP
40 lines
800 B
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\admin\model\v1;
|
|
|
|
use think\Model;
|
|
|
|
/**
|
|
* @mixin \think\Model
|
|
*/
|
|
class LanguageModel extends Model
|
|
{
|
|
// 表名
|
|
protected $name = 'sys_language';
|
|
|
|
// 主键
|
|
protected $pk = 'id';
|
|
|
|
// 字段信息
|
|
protected $schema = [
|
|
'id' => 'int',
|
|
'country_id' => 'int',
|
|
'name' => 'string',
|
|
'code' => 'string',
|
|
'icon' => 'string',
|
|
'url' => 'string',
|
|
'status' => 'int',
|
|
'is_default' => 'int',
|
|
'sort' => 'int',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
// 关联国家
|
|
public function country()
|
|
{
|
|
return $this->belongsTo(CountryModel::class, 'country_id', 'id');
|
|
}
|
|
}
|