项目初始化

This commit is contained in:
2026-03-18 15:54:43 +08:00
commit dfcd762e23
601 changed files with 57883 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
namespace app\admin\controller\crud;
use app\admin\model\CrudLog;
use app\common\controller\Backend;
use Webman\Http\Request;
use support\Response;
class Log extends Backend
{
protected ?object $model = null;
protected array|string $preExcludeFields = ['id', 'create_time'];
protected array|string $quickSearchField = ['id', 'table_name', 'comment'];
protected array $noNeedPermission = ['index'];
protected function initController(Request $request): ?Response
{
$this->model = new CrudLog();
if (!$this->auth->check('crud/crud/index')) {
return $this->error(__('You have no permission'), [], 401);
}
return null;
}
public function index(Request $request): Response
{
$response = $this->initializeBackend($request);
if ($response !== null) return $response;
if ($request->get('select') || $request->post('select')) {
return $this->select($request);
}
list($where, $alias, $limit, $order) = $this->queryBuilder();
$res = $this->model
->withJoin($this->withJoinTable ?? [], $this->withJoinType ?? 'LEFT')
->alias($alias)
->where($where)
->order($order)
->paginate($limit);
return $this->success('', [
'list' => $res->items(),
'total' => $res->total(),
'remark' => get_route_remark(),
]);
}
}