init: 项目初始代码
This commit is contained in:
37
app/api/model/Language.php
Normal file
37
app/api/model/Language.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace app\api\model;
|
||||
|
||||
|
||||
/**
|
||||
* 语言包模型
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class Language extends BaseModel
|
||||
{
|
||||
protected $schema = [
|
||||
'id' => 'int',
|
||||
'name' => 'string',
|
||||
'code' => 'string',
|
||||
'icon' => 'string',
|
||||
'locale' => 'string',
|
||||
'coin' => 'string',
|
||||
'sort' => 'int',
|
||||
'status' => 'int',
|
||||
'create_time' => 'int',
|
||||
'update_time' => 'int'
|
||||
];
|
||||
|
||||
/**
|
||||
* 查找语言包是否被使用
|
||||
* @param $id
|
||||
* @return array|\think\Model|null
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getLanguageUse($id)
|
||||
{
|
||||
return Platform::where('language_id',$id)->find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user