李帅

1.优化一言添加

......@@ -125,6 +125,7 @@ class VideoTempController extends AdminController
$form->radio('draw', '文字效果')
->options(['fade'=>'淡入淡出', 'fix'=>'固定显示'])->default('fade')
->when('fade',function (Form\NestedForm $form){
$form->number('fade_time', 'fade时间')->default(1500);
$form->selectTable('font_file','字体')
->title('字体选择')
->from(FontTable::make())
......
......@@ -66,6 +66,12 @@ class DevFFmpeg extends Command
*/
public function handle()
{
// $json = shell_exec(env('FFPROBE_CMD') . ' -v quiet -print_format json -show_format -show_streams ' . escapeshellarg(storage_path('app/public/uploads/131/309/K4LTgHuDhcmDr3MZBDkd0vyMUmRbfBxrFbU0CoNs.png')). ' 2>&1');
// $arr = json_decode($json,true);
// dd($arr);
// dd(AdminMakeVideo::query()->find(1)->poem2());
dd(AdminMakeVideo::query()->find(1)->poem2->verses->toArray());
return 0;
dd(AdminMakeVideo::query()->find(33)->temp->components->toArray());
AdminMakeImmerse::dispatch(AdminMakeVideo::query()->find(33)->temp->components);
......
This diff is collapsed. Click to expand it.
......@@ -38,6 +38,11 @@ class AdminMakeVideo extends Model
return $this->hasOne(OnePoem::class,'id','poem_id');
}
public function poem2()
{
return $this->hasOne(OnePoem2::class,'id','poem_id');
}
public function temp()
{
return $this->hasOne(VideoTemp::class,'id','temp_id');
......
......@@ -34,7 +34,7 @@ class VideoTemp extends Model
public function componentsTable()
{
return $this->hasMany('App\Models\Component', 'temp_id')
->select(['id', 'temp_id', 'name', 'position', 'font_size', 'text_color', 'text_bg_color', 'text_bg_box','opacity','fix_bounds']);
->select(['id', 'temp_id', 'name', 'position', 'font_size', 'text_color', 'text_bg_color', 'text_bg_box','opacity']);
}
public function admin_make_video()
......
......@@ -17,6 +17,7 @@ class UpdateComponentsTable extends Migration
Schema::table('components', function (Blueprint $table) {
$table->string('draw')->after('position')->comment('文字效果');
$table->integer('fade_time')->after('draw')->default(1500)->comment('fade切换时间(毫秒)');
});
}
......@@ -27,6 +28,8 @@ class UpdateComponentsTable extends Migration
*/
public function down()
{
Schema::dropColumns('components', ['draw', 'fade_time']);
Schema::table('components', function (Blueprint $table) {
$table->string('fix_bounds')->after('opacity')->comment('超出避免剪切');
});
......