Showing
3 changed files
with
10 additions
and
7 deletions
| ... | @@ -13,6 +13,7 @@ use Dcat\Admin\Grid; | ... | @@ -13,6 +13,7 @@ use Dcat\Admin\Grid; |
| 13 | use Dcat\Admin\Layout\Content; | 13 | use Dcat\Admin\Layout\Content; |
| 14 | use Dcat\Admin\Show; | 14 | use Dcat\Admin\Show; |
| 15 | use Dcat\Admin\Http\Controllers\AdminController; | 15 | use Dcat\Admin\Http\Controllers\AdminController; |
| 16 | +use Illuminate\Support\Facades\Storage; | ||
| 16 | 17 | ||
| 17 | class AdminMakeVideoController extends AdminController | 18 | class AdminMakeVideoController extends AdminController |
| 18 | { | 19 | { |
| ... | @@ -27,15 +28,17 @@ class AdminMakeVideoController extends AdminController | ... | @@ -27,15 +28,17 @@ class AdminMakeVideoController extends AdminController |
| 27 | $grid->model()->where('user_id','=',1); | 28 | $grid->model()->where('user_id','=',1); |
| 28 | 29 | ||
| 29 | $grid->column('id')->sortable(); | 30 | $grid->column('id')->sortable(); |
| 30 | - $grid->column('title'); | 31 | + $grid->column('title','标题'); |
| 31 | - $grid->column('content'); | 32 | + $grid->column('content','有感'); |
| 32 | - $grid->column('url')->image(); | 33 | + $grid->column('url')->display(function ($url){ |
| 33 | - $grid->column('type'); | 34 | + return "<a target='_blank' href='". Storage::disk('public')->url('/ffmpeg/'.basename($url)) ."'>查看</a>"; |
| 35 | + }); | ||
| 36 | + $grid->column('type','类型')->using([1 => '视频', 2 => '音频']); | ||
| 34 | $grid->column('duration'); | 37 | $grid->column('duration'); |
| 35 | $grid->column('size'); | 38 | $grid->column('size'); |
| 36 | $grid->column('poem_id'); | 39 | $grid->column('poem_id'); |
| 37 | $grid->column('temp_id'); | 40 | $grid->column('temp_id'); |
| 38 | - $grid->column('thumbnail'); | 41 | + $grid->column('thumbnail')->image(); |
| 39 | $grid->column('bgm'); | 42 | $grid->column('bgm'); |
| 40 | $grid->column('created_at'); | 43 | $grid->column('created_at'); |
| 41 | $grid->column('updated_at')->sortable(); | 44 | $grid->column('updated_at')->sortable(); | ... | ... |
| ... | @@ -119,7 +119,7 @@ class MakeVideo implements ShouldQueue | ... | @@ -119,7 +119,7 @@ class MakeVideo implements ShouldQueue |
| 119 | Immerse::query()->create([ | 119 | Immerse::query()->create([ |
| 120 | 'user_id' => 1, | 120 | 'user_id' => 1, |
| 121 | 'title' => '', | 121 | 'title' => '', |
| 122 | - 'content' => $this->adminMakeVideo->feel ?? '-', | 122 | + 'content' => $this->adminMakeVideo->feel, |
| 123 | 'url' => $video2, | 123 | 'url' => $video2, |
| 124 | 'type' => $this->adminMakeVideo->type == 1 ? 2 : 1, | 124 | 'type' => $this->adminMakeVideo->type == 1 ? 2 : 1, |
| 125 | 'duration' => $video_info['format']['duration'], | 125 | 'duration' => $video_info['format']['duration'], | ... | ... |
| ... | @@ -21,7 +21,7 @@ class CreateAdminMakeVideoTable extends Migration | ... | @@ -21,7 +21,7 @@ class CreateAdminMakeVideoTable extends Migration |
| 21 | $table->string('images_url')->nullable()->comment('图片地址'); | 21 | $table->string('images_url')->nullable()->comment('图片地址'); |
| 22 | $table->unsignedTinyInteger('bg_music')->comment('是否背景音'); | 22 | $table->unsignedTinyInteger('bg_music')->comment('是否背景音'); |
| 23 | $table->string('bgm_url')->nullable()->comment('背景音地址'); | 23 | $table->string('bgm_url')->nullable()->comment('背景音地址'); |
| 24 | - $table->string('feel')->default('')->comment('有感'); | 24 | + $table->text('feel')->nullable()->comment('有感'); |
| 25 | $table->string('temp_id')->default('')->comment('模板id'); | 25 | $table->string('temp_id')->default('')->comment('模板id'); |
| 26 | $table->unsignedTinyInteger('thumbnail')->comment('封面图'); | 26 | $table->unsignedTinyInteger('thumbnail')->comment('封面图'); |
| 27 | $table->string('thumbnail_url')->nullable()->comment('封面图地址'); | 27 | $table->string('thumbnail_url')->nullable()->comment('封面图地址'); | ... | ... |
-
Please register or login to post a comment