Merge branch 'master' of https://gitlab.huma.net/ludo/opensem
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Price extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $table = 'shop_prices';
|
||||
|
||||
public function article()
|
||||
{
|
||||
return $this->belongsTo(Article::class);
|
||||
}
|
||||
|
||||
public function article_family()
|
||||
{
|
||||
return $this->belongsTo(ArticleNature::class);
|
||||
}
|
||||
|
||||
public function scopeByArticle($query, $id)
|
||||
{
|
||||
return $query->where($this->table.'.article_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByArticleNature($query, $id)
|
||||
{
|
||||
return $query->where($this->table.'.article_family_id', $id);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PriceGenericCategory extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $table = 'shop_price_generic_categories';
|
||||
|
||||
public function article_family()
|
||||
{
|
||||
return $this->belongsTo(ArticleNature::class);
|
||||
}
|
||||
|
||||
public function price_generics()
|
||||
{
|
||||
return $this->hasMany(PriceGeneric::class, 'category_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user