42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace app\index\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 array $data 查询条件
|
|
* @param mixed $simple 模糊搜索条件
|
|
* @param mixed $focus 精准搜索条件
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
*/
|
|
public function getAllList($data,$simple = null,$focus = null,$sort = null)
|
|
{
|
|
$lang = Site::where('platform_id',$data['platform_id'])->column('language_id');
|
|
return $this->order($sort)->where('id','in',$lang)->select()->toArray();
|
|
}
|
|
}
|