修复CURD代码生成模块-生成的代码报错500
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace {%namespace%};
|
||||
{%use%}
|
||||
use app\common\controller\Backend;
|
||||
use support\Response;
|
||||
use Webman\Http\Request as WebmanRequest;
|
||||
|
||||
/**
|
||||
* {%tableComment%}
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* 查看
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function index(): void
|
||||
protected function _index(): Response
|
||||
{
|
||||
// 如果是 select 则转发到 select 方法,若未重写该方法,其实还是继续执行 index
|
||||
if ($this->request->param('select')) {
|
||||
$this->select();
|
||||
if ($this->request && $this->request->get('select')) {
|
||||
return $this->select($this->request);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@
|
||||
->order($order)
|
||||
->paginate($limit);
|
||||
|
||||
$this->success('', [
|
||||
return $this->success('', [
|
||||
'list' => $res->items(),
|
||||
'total' => $res->total(),
|
||||
'remark' => get_route_remark(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
public function initialize(): void
|
||||
protected function initController(WebmanRequest $request): ?Response
|
||||
{
|
||||
parent::initialize();
|
||||
$this->model = new \{%modelNamespace%}\{%modelName%}();{%filterRule%}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user