'integer', 'store_id' => 'integer', 'product_id' => 'integer', 'price' => 'decimal:2', 'quantity' => 'decimal:2', 'weight' => 'decimal:3', 'amount' => 'decimal:2', ]; /** * 所属订单 */ public function order(): BelongsTo { return $this->belongsTo(StoreOrderModel::class, 'order_id', 'id'); } /** * 下单门店 */ public function store(): BelongsTo { return $this->belongsTo(StoreModel::class, 'store_id', 'id'); } /** * 下单商品 */ public function product(): BelongsTo { return $this->belongsTo(ProductModel::class, 'product_id', 'id'); } }