6
0
Fork 0
release
panliang 2022-06-15 09:45:40 +08:00
parent 71e1e7c0ee
commit 4f106ec43e
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@
namespace App\Admin\Renderable;
use App\Models\ProductPartSku;
use App\Models\ProductPartSpu;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;
@ -12,7 +13,7 @@ class ProductPartSpuTable extends LazyRenderable
{
$partId = $this->payload['id'];
// dd($partId);
$builder = ProductPartSku::query();
$builder = ProductPartSpu::query();
$builder->with('spu')->where('part_id', $partId);
return Grid::make($builder, function (Grid $grid) {
$grid->column('spu.name', __('product-sku.fields.name'));

View File

@ -34,7 +34,7 @@ class ProductPartSpu extends Model
public function spu()
{
return $this->belongsTo(ProductSpu::class, 'sku_id');
return $this->belongsTo(ProductSpu::class, 'spu_id');
}
/**