error("$modelName . DS . add.html已经存在"); exit; } } public function make($table, $path, $other) { $addTpl = dirname(dirname(__DIR__)) . '/tpl/add.tpl'; $tplContent = file_get_contents($addTpl); $model = $table; $filePath = empty($path) ? '' : DS . $path; $namespace = empty($path) ? '\\' : '\\' . $path . '\\'; $prefix = config('database.connections.mysql.prefix'); $column = Db::query('SHOW FULL COLUMNS FROM `' . $prefix . $table . '`'); $pk = ''; foreach ($column as $vo) { if ($vo['Key'] == 'PRI') { $pk = $vo['Field']; break; } } /* //读取数据结构生成字段 $tritems =''; $index =0; foreach ($column as $key => $vo) { $field = $vo['Field']; $title = $vo['Comment']==''?$field:$vo['Comment']; if($field != 'id'){ if(($index % 3) == 0){ $tritems.="