Browse Source

Update api

dyjh 6 năm trước cách đây
mục cha
commit
cc4e8c0ad8
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      app/Http/Controllers/Api/V1/AlbumController.php

+ 3 - 3
app/Http/Controllers/Api/V1/AlbumController.php

xqd
@@ -714,17 +714,17 @@ class AlbumController extends Controller
         switch ($type){
             case '1':
                 if(!$request->input('user_id')) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
-                $query = $query->andWhere(['user_id',$request->input('user_id')]);
+                $query = $query->Where(['user_id',$request->input('user_id')]);
                 break;
             case '2':
                 if(!$request->input('start_time')||!$request->input('end_time')) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
                 $start_time = date('Y-m-d H:i:s',$request->input('start_time'));
                 $end_time = date('Y-m-d H:i:s',$request->input('end_time'));
-                $query = $query->andWhere([['created_at','>=',$start_time],['created_at','<=',$end_time]]);
+                $query = $query->Where([['created_at','>=',$start_time],['created_at','<=',$end_time]]);
                 break;
             case '3':
                 if(!$request->input('action')) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
-                $query = $query->andWhere(['action',$request->input('action')]);
+                $query = $query->Where(['action',$request->input('action')]);
                 break;
         }
         $res = $query->get();