41 lines
978 B
PHP
41 lines
978 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use App\Models\Live\Anchor;
|
||
|
|
use Actuallymab\LaravelComment\Contracts\Commentable;
|
||
|
|
use Actuallymab\LaravelComment\HasComments;
|
||
|
|
use App\Traits\Haslike;
|
||
|
|
use App\Contracts\Likerable;
|
||
|
|
use App\Contracts\Logable;
|
||
|
|
use App\Traits\Haslog;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class AnchorVideo extends Model implements Likerable,Commentable,Logable
|
||
|
|
{
|
||
|
|
use HasComments;
|
||
|
|
use Haslike;
|
||
|
|
use SoftDeletes;
|
||
|
|
use Haslog;
|
||
|
|
use \Conner\Tagging\Taggable;
|
||
|
|
public function anchor(){
|
||
|
|
return $this->hasOne(Anchor::class,'m_id','m_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getCoverAttribute($value)
|
||
|
|
{
|
||
|
|
if($value){
|
||
|
|
if(!strpos('local-pictures',$value)&&!strpos($value,'x-oss-process')){
|
||
|
|
return $value.Config('image.watermark');
|
||
|
|
}else{
|
||
|
|
return $value;
|
||
|
|
}
|
||
|
|
}else{
|
||
|
|
return $value;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|