43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller\CommonApi;
|
|
|
|
use app\BaseController;
|
|
use app\Request;
|
|
use think\Validate;
|
|
use think\exception\ValidateException;
|
|
use think\facade\Filesystem;
|
|
use app\common\model\Dictionary\Dictionary as ModelDictionary;
|
|
use app\common\arw\adjfut\src\Excel;
|
|
use app\common\arw\adjfut\src\UploadFile;
|
|
use app\common\exception\Tool;
|
|
use think\facade\Db;
|
|
use think\facade\Env;
|
|
use think\captcha\facade\Captcha;
|
|
use think\helper\Arr;
|
|
|
|
class CommonApi extends BaseController
|
|
{
|
|
/**
|
|
* 获取数据字典接口
|
|
*
|
|
* @param Request $request
|
|
* @return array
|
|
* @date 2023-07-14
|
|
* @author xjh
|
|
* @since 1.0.0
|
|
*/
|
|
public function getDictionaryList(Request $request): array
|
|
{
|
|
$params = $request->param();
|
|
$this->validate($params, [
|
|
'dictionary_value|数据字典值' => 'require|in:library_type,global_mode',
|
|
]);
|
|
$select = ModelDictionary::getDictionaryData($params['dictionary_value']);
|
|
return [
|
|
'code' => 0,
|
|
'msg' => 'ok',
|
|
'data' => $select
|
|
];
|
|
}
|
|
} |