Jelajahi Sumber

add book filter , drop summary

visuddhinanda 2 minggu lalu
induk
melakukan
c83b4c0f2d
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      api-v13/app/Http/Controllers/ProgressController.php

+ 6 - 1
api-v13/app/Http/Controllers/ProgressController.php

@@ -16,9 +16,11 @@ class ProgressController extends Controller
     public function index(Request $request)
     public function index(Request $request)
     {
     {
         //
         //
+        $select = ['book', 'para', 'lang', 'progress', 'channel_id', 'title', 'last_chapter_completed_at', 'updated_at'];
         switch ($request->input('view')) {
         switch ($request->input('view')) {
             case 'channel':
             case 'channel':
-                $table = ProgressChapter::whereIn('channel_id', explode('_', $request->input('channels', '')));
+                $table = ProgressChapter::select($select)
+                    ->whereIn('channel_id', explode('_', $request->input('channels', '')));
                 break;
                 break;
             default:
             default:
                 return $this->error('invalid view', 400, 400);
                 return $this->error('invalid view', 400, 400);
@@ -28,6 +30,9 @@ class ProgressController extends Controller
         if ($request->has('lang')) {
         if ($request->has('lang')) {
             $table = $table->where('lang', $request->input('lang'));
             $table = $table->where('lang', $request->input('lang'));
         }
         }
+        if ($request->has('book')) {
+            $table = $table->where('book', $request->input('book'));
+        }
         $count = $table->count();
         $count = $table->count();
 
 
         $table = $table->orderBy(
         $table = $table->orderBy(