28 lines
547 B
PHP
28 lines
547 B
PHP
<?php
|
|
|
|
namespace App\Repositories\Shop;
|
|
|
|
use App\Models\Shop\Price;
|
|
use App\Traits\Model\Basic;
|
|
|
|
class Prices
|
|
{
|
|
use Basic;
|
|
|
|
public static function getByArticle($id)
|
|
{
|
|
return [
|
|
'prices' => Price::byArticle($id)->notGeneric()->get()->toArray(),
|
|
'generics' => Price::byArticle($id)->generic()->with([
|
|
'generic.prices',
|
|
'generic.category',
|
|
])->get()->toArray(),
|
|
];
|
|
}
|
|
|
|
public static function getModel()
|
|
{
|
|
return Price::query();
|
|
}
|
|
}
|