chenxiqiang 6 роки тому
джерело
коміт
f3b1e1a92b

+ 13
- 0
manage-server/app/Http/Controllers/CommonController.php Переглянути файл

@@ -144,6 +144,19 @@ class CommonController extends Controller
144 144
         }
145 145
     }
146 146
 
147
+    /**
148
+     * 分页获取订单评论
149
+     * @param Request $request
150
+     * @return mixed
151
+     */
152
+    public function type_comments(Request $request, $order_type)
153
+    {
154
+        $order_type = $request->route("order_type");
155
+        if ($order_type) {
156
+            return Comment::where("type", $order_type)->orderBy('type', 'desc')->paginate(20);
157
+        }
158
+    }
159
+
147 160
     /**
148 161
      * 获取我的订单
149 162
      * @param Request $request

+ 1
- 1
manage-server/routes/web.php Переглянути файл

@@ -27,7 +27,7 @@ Route::middleware(['manage.token'])->group(function () {
27 27
 
28 28
     Route::post('/upload', 'CommonController@upload');
29 29
     Route::get('/classify/{id}', 'ClassifyController@get');
30
-    Route::get('/{order_type}/{order_id}/comments', 'CommonController@comments');
30
+    Route::get('/{order_type}/comments', 'CommonController@type_comments');
31 31
     Route::post('/{order_type}/status', 'CommonController@status');
32 32
     Route::get('/{order_type}/{id}', 'CommonController@get')->where('id', '[0-9]+');
33 33
     Route::delete('/{order_type}/{id}', 'CommonController@delete')->where('id', '[0-9]+');

Loading…
Відмінити
Зберегти