26 lines
481 B
PHP
26 lines
481 B
PHP
<?php
|
|
|
|
namespace App\Models\Shop;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ArticlePrice extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
public function Article()
|
|
{
|
|
return $this->belongsTo('App\Models\Shop\Article');
|
|
}
|
|
|
|
public function ArticleAttribute()
|
|
{
|
|
return $this->belongsTo('App\Models\Shop\ArticleAttribute');
|
|
}
|
|
|
|
public function scopeByArticle($query, $id)
|
|
{
|
|
return $query->where('article_id', $id);
|
|
}
|
|
|
|
} |