付款与收款
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user