Add new version in repository

This commit is contained in:
Ludovic CANDELLIER
2021-07-25 23:19:27 +02:00
parent f75632b054
commit b879f11c99
608 changed files with 12235 additions and 7513 deletions

View File

@@ -2,54 +2,33 @@
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Model;
use Staudenmeir\EloquentHasManyDeep\HasRelationships;
class Price extends Model
{
use HasRelationships;
use HasRelationships;
protected $guarded = ['id'];
protected $table = 'shop_prices';
protected $guarded = ['id'];
protected $table = 'shop_prices';
public function article()
{
return $this->belongsTo('App\Models\Shop\Article');
}
public function article()
{
return $this->belongsTo('App\Models\Shop\Article');
}
public function article_family()
{
return $this->belongsTo('App\Models\Shop\ArticleFamily');
}
public function article_family()
{
return $this->belongsTo('App\Models\Shop\ArticleNature');
}
public function generic()
{
return $this->belongsTo('App\Models\Shop\PriceGeneric', 'price_generic_id');
}
public function scopeByArticle($query, $id)
{
return $query->where('article_id', $id);
}
public function generic_prices()
{
}
public function scopeByArticle($query, $id)
{
return $query->where('article_id', $id);
}
public function scopeByArticleFamily($query, $id)
{
return $query->where('article_family_id', $id);
}
public function scopeGeneric($query)
{
return $query->whereNotNull('price_generic_id');
}
public function scopeNotGeneric($query)
{
return $query->whereNull('price_generic_id');
}
}
public function scopeByArticleNature($query, $id)
{
return $query->where('article_family_id', $id);
}
}