VideoTemp.php
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class VideoTemp extends Model
{
use HasDateTimeFormatter;
const POSITION_OPTIONS = [
'topLeft'=>'上左','topMiddle'=>'上中','topRight'=>'上右',
'midLeft'=>'中左','midMiddle'=>'中中','midRight'=>'中右',
'botLeft'=>'下左','botMiddle'=>'下中','botRight'=>'下右',
];
const POSITION_FFMPEG = [
'topLeft' => [0, 0], 'topMiddle' => ['(w-text_w)/2', 0], 'topRight' => ['w-text_w', 0],
'midLeft' => [0, '(h-text_h)/2'], 'midMiddle' => ['(w-text_w)/2', '(h-text_h)/2'], 'midRight' => ['w-text_w', '(h-text_h)/2'],
'botLeft' => [0, 'h-text_h'], 'botMiddle' => ['(w-text_w)/2', 'h-text_h'], 'botRight' => ['w-text_w', 'h-text_h'],
];
protected $table = 'video_temp';
protected $guarded = [''];
public function components()
{
return $this->hasMany('App\Models\Component','temp_id');
}
public function componentsTable()
{
return $this->hasMany('App\Models\Component','temp_id')->select(['id','temp_id','name','position','font_size']);
}
}