This commit is contained in:
wuyanwen 2019-12-27 15:56:56 +08:00
parent ef30c07f4a
commit fcc2e04b85
2 changed files with 27 additions and 21 deletions

View File

@ -11,17 +11,6 @@ use think\Paginator;
class DataDictionary extends CatchController class DataDictionary extends CatchController
{ {
/**
*
* @time 2019年12月13日
* @throws \Exception
* @return string
*/
public function index(): string
{
return $this->fetch();
}
/** /**
* *
* @time 2019年12月13日 * @time 2019年12月13日
@ -64,18 +53,22 @@ class DataDictionary extends CatchController
return CatchResponse::paginate(Paginator::make(!$searchMode ? $tables : $searchTables, $request->get('limit') ?? 10, $request->get('page') ?? 1, $searchMode ? count($searchTables) : count($tables), false, [])); return CatchResponse::paginate(Paginator::make(!$searchMode ? $tables : $searchTables, $request->get('limit') ?? 10, $request->get('page') ?? 1, $searchMode ? count($searchTables) : count($tables), false, []));
} }
/** /**
* *
* @time 2019年12月13日 * @time 2019年12月13日
* @param $table * @param $table
* @throws \Exception * @return \think\response\Json
* @return string * @throws \Exception
*/ */
public function view($table): string public function view($table): \think\response\Json
{ {
$this->table = Db::query('show full columns from ' . $table); $fields = Db::query('show full columns from ' . $table);
return $this->fetch(); array_walk($fields, function (&$item){
$item = array_change_key_case($item);
});
return CatchResponse::success($fields);
} }
/** /**

View File

@ -0,0 +1,13 @@
<template>
$END$
</template>
<script>
export default {
name: 'table'
}
</script>
<style scoped>
</style>