init: 项目初始代码
This commit is contained in:
41
app/index/model/Language.php
Normal file
41
app/index/model/Language.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user