Add display articles & categories, raw mode
This commit is contained in:
@@ -26,9 +26,14 @@ class Article extends Model implements HasMedia
|
||||
return $this->hasMany('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
public function prices()
|
||||
public function images()
|
||||
{
|
||||
return $this->hasManyThrough('App\Models\Shop\ArticlePrice','App\Models\Shop\ArticleAttribute');
|
||||
return $this->hasMany('App\Models\Core\Media','model_id')->where('model_type','App\Models\Shop\Article');
|
||||
}
|
||||
|
||||
public function image()
|
||||
{
|
||||
return $this->hasOne('App\Models\Core\Media','model_id')->where('model_type','App\Models\Shop\Article');
|
||||
}
|
||||
|
||||
public function inventories()
|
||||
@@ -41,6 +46,11 @@ class Article extends Model implements HasMedia
|
||||
return $this->hasMany('App\Models\Shop\InvoiceItem');
|
||||
}
|
||||
|
||||
public function prices()
|
||||
{
|
||||
return $this->hasManyThrough('App\Models\Shop\ArticlePrice','App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->morphTo();
|
||||
|
||||
Reference in New Issue
Block a user