新款导入节目单,自动匹配时间(需提前导入分P信息)

This commit is contained in:
2022-08-24 20:54:34 +08:00
parent 00acb688c5
commit 5cbf9ff177
6 changed files with 105 additions and 40 deletions

View File

@ -6,6 +6,13 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
/**
* @property Carbon $created_at
* @property int $stop_part
* @property int $start_part
* @property int $startSec
* @property int $stopSec
*/
class ProgramVideos extends Model
{
protected $fillable = ["video_bvid", "start_part", "start_time", "stop_part", "stop_time"];

View File

@ -4,9 +4,15 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* @property \Carbon\Carbon $duration
*/
class VideoParts extends Model
{
public $timestamps = false;
protected $casts = [
"duration" => "datetime",
];
public function video(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Videos::class, "bvid", "bvid");