$params['name']]; $language = Language::field($field) ->where($where) ->findOrEmpty() ->toArray(); return $language; } /** * @notes 语言数据 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/10/13 10:53 */ public static function getAllData() { $field = ['id','name_loc as name','symbol','precision','time_format']; $langs = Language::field($field) ->where(['is_show' => YesNoEnum::YES]) ->order(['sort' => 'desc', 'id' => 'desc']) ->select() ->toArray(); return $langs; } /** * @notes 语言包数据 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/10/13 10:53 */ public static function getPagAllData($params) { //查询语言 $language = Language::where(['symbol' => $params['lang']])->findOrEmpty(); if ($language->isEmpty()) { throw new \Exception('network.parameterAbnormality');//参数异常 } $field = ['type','name','value']; $pags = LanguagePag::field($field) ->where(['lang' => $params['lang']]) ->order(['type' => 'asc','name' => 'asc', 'value' => 'asc']) ->select() ->toArray(); return $pags; } }