2025-09-23 15:13:56 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\common\model;
|
|
|
|
|
|
|
|
|
|
use support\Model;
|
|
|
|
|
|
|
|
|
|
class FinPaymentApply 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_apply';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 允许自动填充模型字段
|
|
|
|
|
*/
|
2025-10-29 18:05:23 +08:00
|
|
|
protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'created_at', 'updated_at', 'claimed_by',];
|
2025-09-23 15:13:56 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 不允许自动填充模型字段
|
|
|
|
|
*/
|
|
|
|
|
protected $guarded = [];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取对应的收款记录(1-1,可为空)
|
|
|
|
|
*/
|
|
|
|
|
public function receipt()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasOne(FinReceipt::class, 'payment_apply_id', 'id');
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-23 15:14:08 +08:00
|
|
|
/**
|
|
|
|
|
* 关联的备货单(通过中间表)
|
|
|
|
|
*/
|
|
|
|
|
public function stocks()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany(StockOrders::class, 'fin_payment_stock', 'payment_apply_id', 'stock_id');
|
|
|
|
|
}
|
2025-09-23 15:13:56 +08:00
|
|
|
}
|