Kaynağa Gözat

feat(api): 更新反馈列表接口参数获取方式

- 将页面和限制参数从解构赋值改为通过request()->params方法获取
- 添加默认值处理,当page或limit未提供时使用默认值
- 优化参数传递逻辑,提高代码可读性
shichen 4 ay önce
ebeveyn
işleme
10867a6498
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      app/controller/api/user/Feedback.php

+ 2 - 2
app/controller/api/user/Feedback.php

@@ -52,8 +52,8 @@ class Feedback
52 52
      */
53 53
     public function feedbackList()
54 54
     {
55
-        [$page, $limit] = $this->getPage();
56
-        return app('json')->success($this->repository->getList(['uid' => request()->uid(), 'is_del' => 0], $page, $limit));
55
+        $data = request()->params(['page', 'limit']);
56
+        return app('json')->success($this->repository->getList(['uid' => request()->uid(), 'is_del' => 0], $data['page'] ?? 1, $data['limit'] ?? 20));
57 57
     }
58 58
 
59 59
     public function detail($id)