Fix on AdminLTE 3, and add some features
This commit is contained in:
@@ -2,17 +2,27 @@
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticleAttribute extends Pivot
|
||||
class ArticleAttribute extends Model
|
||||
{
|
||||
public function article()
|
||||
public function Price()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Article');
|
||||
return $this->belongsTo('App\Models\Shop\ArticlePrice');
|
||||
}
|
||||
|
||||
public function value()
|
||||
public function Value()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
public function scopeByPrice($query, $article_price_id)
|
||||
{
|
||||
return $query->where('article_price_id', $article_price_id);
|
||||
}
|
||||
|
||||
public function scopeByAttribueValue($query, $article_value_id)
|
||||
{
|
||||
return $query->where('article_value_id', $article_value_id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user