付款与收款

This commit is contained in:
2025-09-23 15:13:56 +08:00
parent 4b1aa90734
commit 36d1d333b1
14 changed files with 684 additions and 19 deletions
+67
View File
@@ -0,0 +1,67 @@
<?php
namespace app\common\model;
use support\Model;
class FinPaymentStock extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'fin_payment_stock';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'payment_apply_id', 'receipt_id', 'stock_id', 'allocated_amount', 'allocated_amount_cny'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
// 付款申请
public function payment_apply()
{
return $this->belongsTo(FinPaymentApply::class, 'payment_apply_id', 'id');
}
// 收款记录
public function receipt()
{
return $this->belongsTo(FinReceipt::class, 'receipt_id', 'id');
}
// 付款申请
public function stock()
{
return $this->belongsTo(StockOrders::class, 'stock_id', 'id');
}
}