refactor(zy): 重构查询接口并添加分页功能
- 重构了 Activity、Circle、Club、Game 和 Gym 控制器中的查询方法 - 添加了分页功能,支持指定页码和每页数量 - 优化了查询结果,返回包含总数的格式化数据 - 使用 alias 和 join 方法改进了查询效率 - 删除了 Base 控制器中的通用查询方法
This commit is contained in:
@@ -22,19 +22,6 @@ class Base extends Common
|
||||
$this->user = auth_user();
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$params = $this->request->param();
|
||||
if (isset($params['name'])) {
|
||||
$this->model->where('name', 'like', '%' . $params['name'] . '%');
|
||||
}
|
||||
$res = $this->model->select();
|
||||
|
||||
|
||||
$this->success('Success', $res);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$result = false;
|
||||
|
||||
Reference in New Issue
Block a user