diff --git a/app/api/controller/Tdk/Tdk.php b/app/api/controller/Tdk/Tdk.php index 55f5fd8..a2547c9 100644 --- a/app/api/controller/Tdk/Tdk.php +++ b/app/api/controller/Tdk/Tdk.php @@ -18,71 +18,6 @@ use think\facade\Env; class Tdk extends BaseController { - public function createXmd() - { - $table_all = Db::query('SHOW TABLES'); - $arr = []; - $match = ['_copy', '_copy1', 'demo', '_lpf', '_20']; - $res_str = ''; - foreach ($table_all as $key => $it) { - $item = $it['Tables_in_shop_uniapp']; - $currentMatch = ''; - foreach ($match as $matchKey => $matchItem) { - if (stripos($item, $matchItem) === false) { - $currentMatch = ''; - } else { - $currentMatch = $item; - - break; - } - } - if ($item != $currentMatch) { - $arr[$item] = [ - 'comment' => $table_info = Db::query('SHOW TABLE STATUS LIKE ' . "'" . $item . "'")[0]['Comment'], - 'children' => Db::query('SHOW FULL COLUMNS FROM `' . $item . '`') - ]; - } - } - function createXmdStr(&$res_str, $arr) - { - foreach ($arr as $key => &$item) { - if ($item['comment'] != '') { - $res_str .= "\n{$key}\n\t" . $item['comment']; - if ($item['children']) { - foreach ($item['children'] as $childKey => &$childItem) { - if ($childItem['Comment'] == '') { - $res_str .= "\n\t\t{$childItem['Field']}"; - } else { - $childItem['Comment'] = str_replace(",", ',', $childItem['Comment']); - $childItem['Comment'] = str_replace("]", ')', $childItem['Comment']); - $childItem['Comment'] = str_replace("[", '(', $childItem['Comment']); - $res_str .= "\n\t\t{$childItem['Field']}\n\t\t\t{$childItem['Comment']}"; - } - } - } - } else { - $res_str .= "\n{$key}"; - if ($item['children']) { - foreach ($item['children'] as $childKey => &$childItem) { - if ($childItem['Comment'] == '') { - $res_str .= "\n\t{$childItem['Field']}"; - } else { - $childItem['Comment'] = str_replace(",", ',', $childItem['Comment']); - $childItem['Comment'] = str_replace("]", ')', $childItem['Comment']); - $childItem['Comment'] = str_replace("[", '(', $childItem['Comment']); - $res_str .= "\n\t{$childItem['Field']}\n\t\t{$childItem['Comment']}"; - } - } - } - } - } - } - createXmdStr($res_str, $arr); - - - echo $res_str; - return ''; - } /** * 获取网站tdk详情 */ @@ -92,6 +27,8 @@ class Tdk extends BaseController $this->validate($params, ['tdk_type' => 'require']); + // $params[] + $find = ModelTdk::field([ 'tdk_id', 'tdk_type', diff --git a/public/excel/tdk/网站tdk导入模板 - 副本 (2).xlsx b/public/excel/tdk/网站tdk导入模板 - 副本 (2).xlsx index 4074c73..f0d35c7 100644 Binary files a/public/excel/tdk/网站tdk导入模板 - 副本 (2).xlsx and b/public/excel/tdk/网站tdk导入模板 - 副本 (2).xlsx differ