Browse Source

:fire: use App\Http\Controllers\AuthController;

visuddhinanda 5 days ago
parent
commit
9e95bda177
1 changed files with 9 additions and 3 deletions
  1. 9 3
      api-v12/app/Http/Controllers/ChannelController.php

+ 9 - 3
api-v12/app/Http/Controllers/ChannelController.php

@@ -14,7 +14,6 @@ use App\Models\WbwBlock;
 use App\Models\PaliSentence;
 use App\Models\PaliSentence;
 use App\Models\CustomBook;
 use App\Models\CustomBook;
 
 
-use App\Http\Controllers\AuthController;
 use App\Http\Resources\ChannelResource;
 use App\Http\Resources\ChannelResource;
 
 
 use App\Http\Api\AuthApi;
 use App\Http\Api\AuthApi;
@@ -371,7 +370,13 @@ class ChannelController extends Controller
         }
         }
         //获取单句长度
         //获取单句长度
         if (count($query) > 0) {
         if (count($query) > 0) {
-            $table = Sentence::whereIns(['book_id', 'paragraph', 'word_start', 'word_end', 'channel_uid'], $queryWithChannel)
+            $table = Sentence::whereIns([
+                'book_id',
+                'paragraph',
+                'word_start',
+                'word_end',
+                'channel_uid'
+            ], $queryWithChannel)
                 ->select(['book_id', 'paragraph', 'word_start', 'word_end', 'strlen']);
                 ->select(['book_id', 'paragraph', 'word_start', 'word_end', 'strlen']);
             $sentLen = $table->get();
             $sentLen = $table->get();
 
 
@@ -391,7 +396,8 @@ class ChannelController extends Controller
         //获取全网公开的有译文的channel
         //获取全网公开的有译文的channel
         if ($request->input('owner') === 'all' || $request->input('owner') === 'public') {
         if ($request->input('owner') === 'all' || $request->input('owner') === 'public') {
             if (count($query) > 0) {
             if (count($query) > 0) {
-                $publicChannelsWithContent = Sentence::whereIns(['book_id', 'paragraph', 'word_start', 'word_end'], $query)
+                $fields = ['book_id', 'paragraph', 'word_start', 'word_end'];
+                $publicChannelsWithContent = Sentence::whereIns($fields, $query)
                     ->where('strlen', '>', 0)
                     ->where('strlen', '>', 0)
                     ->where('status', 30)
                     ->where('status', 30)
                     ->groupBy('channel_uid')
                     ->groupBy('channel_uid')