spu
parent
71e1e7c0ee
commit
4f106ec43e
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Admin\Renderable;
|
namespace App\Admin\Renderable;
|
||||||
|
|
||||||
use App\Models\ProductPartSku;
|
use App\Models\ProductPartSku;
|
||||||
|
use App\Models\ProductPartSpu;
|
||||||
use Dcat\Admin\Grid;
|
use Dcat\Admin\Grid;
|
||||||
use Dcat\Admin\Grid\LazyRenderable;
|
use Dcat\Admin\Grid\LazyRenderable;
|
||||||
|
|
||||||
|
|
@ -12,7 +13,7 @@ class ProductPartSpuTable extends LazyRenderable
|
||||||
{
|
{
|
||||||
$partId = $this->payload['id'];
|
$partId = $this->payload['id'];
|
||||||
// dd($partId);
|
// dd($partId);
|
||||||
$builder = ProductPartSku::query();
|
$builder = ProductPartSpu::query();
|
||||||
$builder->with('spu')->where('part_id', $partId);
|
$builder->with('spu')->where('part_id', $partId);
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
$grid->column('spu.name', __('product-sku.fields.name'));
|
$grid->column('spu.name', __('product-sku.fields.name'));
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class ProductPartSpu extends Model
|
||||||
|
|
||||||
public function spu()
|
public function spu()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(ProductSpu::class, 'sku_id');
|
return $this->belongsTo(ProductSpu::class, 'spu_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue