添加点播信息建设内容

This commit is contained in:
2022-07-29 13:36:40 +08:00
parent 4f31bd50c3
commit 27ac801b33
8 changed files with 204 additions and 20 deletions

View File

@ -6,5 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class ProgramAppends extends Model
{
protected $fillable = ["name", "from", "price", "append"];
protected $dateFormat = "U";
}

View File

@ -23,7 +23,7 @@ class ProgramVideos extends Model
public function startSec(): Attribute
{
return Attribute::get(function ($_, $attributes) {
if (!$attributes['start_time']) {
if (!isset($attributes['start_time'])) {
return "";
}
return Carbon::createFromFormat("H:i:s", $attributes['start_time'])->secondsSinceMidnight();
@ -33,7 +33,7 @@ class ProgramVideos extends Model
public function stopSec(): Attribute
{
return Attribute::get(function ($_, $attributes) {
if (!$attributes['stop_time']) {
if (!isset($attributes['stop_time'])) {
return "";
}
return Carbon::createFromFormat("H:i:s", $attributes['stop_time'])->secondsSinceMidnight();