67 lines
1.3 KiB
PHP
67 lines
1.3 KiB
PHP
<?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', 'pi_no', 'payment_apply_id', 'receipt_id', 'stock_id', 'allocated_amount', 'allocated_amount_cny', 'updated_at', 'created_at'];
|
|
|
|
/**
|
|
* 不允许自动填充模型字段
|
|
*/
|
|
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');
|
|
}
|
|
} |