belongsTo(FinPaymentApply::class, 'payment_apply_id', 'id'); } /** * 关联的备货单(通过中间表) */ public function stocks() { return $this->belongsToMany(StockOrders::class, 'fin_payment_stock', 'receipt_id', 'stock_id'); } /** * 关联付款申请 */ // public function finPaymentApply() // { // return $this->hasOne(FinPaymentApply::class, 'receipt_id', 'id'); // } /** * 关联付款申请表 */ public function paymentApply() { return $this->belongsTo(FinPaymentApply::class, 'payment_apply_id', 'id'); } }