liuzejian před 1 rokem
rodič
revize
717b0438db

+ 5 - 2
app/Console/Commands/ContentManage/ContentTest.php

@@ -2,8 +2,11 @@
 
 namespace App\Console\Commands\ContentManage;
 
+use http\Exception\RuntimeException;
 use Illuminate\Console\Command;
 use Illuminate\Support\Facades\Redis;
+use Modules\Common\Errors\Errors;
+use Modules\Common\Exceptions\CommonBusinessException;
 
 class ContentTest extends Command
 {
@@ -26,7 +29,7 @@ class ContentTest extends Command
      */
     public function handle(): void
     {
-        Redis::set('test-aa', 1132412);
-        $this->info(Redis::get('test-aa'));
+       myLog('kkkkk')->info(date('Y-m-d H:i:s'));
+       throw new RuntimeException('kljkjljkjkl');
     }
 }

+ 0 - 4
app/Exceptions/Handler.php

@@ -65,10 +65,6 @@ class Handler extends ExceptionHandler
     public function render($request, Throwable $e): JsonResponse|Response
     {
         $message = $e->getMessage();
-        echo "<pre><hr>";
-        var_export($message);
-        echo  "<hr>";
-        die();
         if (method_exists($e, 'getStatusCode')) {
             if ($e->getStatusCode() == Response::HTTP_NOT_FOUND) {
                 $message = '路由未找到或未注册';

+ 2 - 1
config/logging.php

@@ -4,6 +4,7 @@ use Monolog\Handler\NullHandler;
 use Monolog\Handler\StreamHandler;
 use Monolog\Handler\SyslogUdpHandler;
 
+$hostname = gethostname();
 return [
 
     /*
@@ -65,7 +66,7 @@ return [
 
         'daily' => [
             'driver' => 'daily',
-            'path' => storage_path('logs/laravel.log'),
+            'path' => storage_path('logs/'.$hostname. '/'. env('APP_NAME').'/system/laravel.log'),
             'level' => env('LOG_LEVEL', 'debug'),
             'days' => 14,
         ],

+ 3 - 0
modules/Video/Http/Controllers/VideoController.php

@@ -27,10 +27,13 @@ class VideoController extends CatchController
         $updateType = $request->input('updateType');
         $categoryId = $request->input('categoryId');
         $videoId = $request->input('videoId');
+        $shelfType = $request->input('shelfType');
 
         $videos = DB::table('videos')
             ->when($videoId, function ($query, $videoId){
                 return $query->where('id', $videoId);
+            })->when($shelfType, function ($query, $shelfType){
+                return $query->where('shelf_type', $shelfType);
             })
             ->when($videoName, function ($query, $videoName){
                return $query->where('name', 'like', '%'. $videoName . '%');

+ 20 - 1
tests/Operation/Http/Controllers/FirstPageControllerTest.php

@@ -45,7 +45,26 @@ class FirstPageControllerTest extends UsedTestCase
             'Authorization' => 'Bearer '. $this->token,
         ])->json('post','http://localhost/api/operationManage/firstPage/setConfig', [
             'id' => 4,
-            'duanjus' => []
+            'duanjus' => [
+                [
+                    'sort' => 5,
+                    'id' => 9,
+                    'name' => 'xxx1',
+                ],
+                [
+                    'sort' => 1,
+                    'id' =>10,
+                    'name' => 'xxx2',
+                ],[
+                    'sort' => 3,
+                    'id' =>11,
+                    'name' => 'xxx3',
+                ],[
+                    'sort' => 4,
+                    'id' =>12,
+                    'name' => 'xxx4',
+                ],
+            ]
         ]);
         $res->dump();
         $this->dumpJson($res);