fixes
This commit is contained in:
@@ -10,7 +10,7 @@ class Shelve extends Model
|
||||
use HasRelationships;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_shelves';
|
||||
protected $table = 'shop_categories';
|
||||
|
||||
public function articles()
|
||||
{
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace App\Models\Shop;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Spatie\Translatable\HasTranslations;
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Models\Botanic\Variety;
|
||||
|
||||
class Tag extends Model
|
||||
{
|
||||
@@ -25,19 +27,24 @@ class Tag extends Model
|
||||
return $this->morphedByMany(Article::class, 'taggable');
|
||||
}
|
||||
|
||||
public function varieties()
|
||||
public function group()
|
||||
{
|
||||
return $this->morphedByMany(\App\Models\Botanic\Variety::class, 'taggable');
|
||||
return $this->hasOne(TagGroup::class, 'id', 'tag_group_id');
|
||||
}
|
||||
|
||||
public function shelves()
|
||||
{
|
||||
return $this->morphedByMany(Shelve::class, 'taggable');
|
||||
}
|
||||
|
||||
public function species()
|
||||
{
|
||||
return $this->morphedByMany(\App\Models\Botanic\Specie::class, 'taggable');
|
||||
return $this->morphedByMany(Specie::class, 'taggable');
|
||||
}
|
||||
|
||||
public function group()
|
||||
public function varieties()
|
||||
{
|
||||
return $this->hasOne(TagGroup::class, 'id', 'tag_group_id');
|
||||
return $this->morphedByMany(Variety::class, 'taggable');
|
||||
}
|
||||
|
||||
public function scopeByGroup($query, $id)
|
||||
|
||||
@@ -21,6 +21,12 @@ class Tariff extends Model
|
||||
return $this->belongsTo(SaleChannel::class);
|
||||
}
|
||||
|
||||
public function sale_channels()
|
||||
{
|
||||
// return $this->HasManyThrough(SaleChannel::class, PriceList::class);
|
||||
return $this->HasManyThrough(SaleChannel::class, PriceList::class, 'id', 'id', 'id', 'sale_channel_id');
|
||||
}
|
||||
|
||||
public function tariff_unity()
|
||||
{
|
||||
return $this->belongsTo(TariffUnity::class);
|
||||
|
||||
Reference in New Issue
Block a user