upate
This commit is contained in:
@@ -55,7 +55,7 @@ class Generator
|
|||||||
// 只有最后成功才写入 route
|
// 只有最后成功才写入 route
|
||||||
(new Route())->controller($controller['controller'])
|
(new Route())->controller($controller['controller'])
|
||||||
->restful($controller['restful'])
|
->restful($controller['restful'])
|
||||||
->methods((new Controller())->parseOtherMethods($controller['other_function']))
|
// ->methods((new Controller())->parseOtherMethods($controller['other_function']))
|
||||||
->done();
|
->done();
|
||||||
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
@@ -76,10 +76,10 @@ class Generator
|
|||||||
*/
|
*/
|
||||||
public function preview($params)
|
public function preview($params)
|
||||||
{
|
{
|
||||||
$params = \json_decode($params['data'], true);
|
|
||||||
|
|
||||||
$type = $params['type'];
|
$type = $params['type'];
|
||||||
|
|
||||||
|
$params = \json_decode($params['data'], true);
|
||||||
|
|
||||||
[$controller, $model] = $this->parseParams($params);
|
[$controller, $model] = $this->parseParams($params);
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
@@ -113,7 +113,7 @@ class Generator
|
|||||||
'model' => $params['controller']['model'] ?? '',
|
'model' => $params['controller']['model'] ?? '',
|
||||||
'controller' => $params['controller']['controller'] ?? '',
|
'controller' => $params['controller']['controller'] ?? '',
|
||||||
'restful' => $params['controller']['restful'],
|
'restful' => $params['controller']['restful'],
|
||||||
'other_function' => $params['controller']['other_function'],
|
// 'other_function' => $params['controller']['other_function'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$table = $params['controller']['table'] ?? '';
|
$table = $params['controller']['table'] ?? '';
|
||||||
@@ -124,8 +124,8 @@ class Generator
|
|||||||
$model = [
|
$model = [
|
||||||
'table' => $table,
|
'table' => $table,
|
||||||
'model' => $params['controller']['model'] ?? '',
|
'model' => $params['controller']['model'] ?? '',
|
||||||
'sql' => $params['model']['data'],
|
'sql' => $params['table_fields'],
|
||||||
'extra' => $params['model']['extra'],
|
'extra' => $params['table_extra'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@@ -92,13 +92,14 @@ class Controller extends Factory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
if (!empty($params['other_function'])) {
|
if (!empty($params['other_function'])) {
|
||||||
$others = $this->parseOtherMethods($params['other_function']);
|
$others = $this->parseOtherMethods($params['other_function']);
|
||||||
$this->methods = array_merge($this->methods, $others);
|
$this->methods = array_merge($this->methods, $others);
|
||||||
foreach ($others as $other) {
|
foreach ($others as $other) {
|
||||||
$content .= $template->otherFunction($other[0], $other[1]);
|
$content .= $template->otherFunction($other[0], $other[1]);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user