Merge branch 'develop'
This commit is contained in:
@@ -50,11 +50,11 @@ class StockOrders extends Model
|
||||
'clearance_country_id', 'clearance_country_snapshot', 'ali_order_no',
|
||||
'customer_source_id', 'customer_source_snapshot', 'customer_id', 'customer_snapshot',
|
||||
'customer_country_id', 'customer_country_snapshot', 'declarant_name', 'eta_ship_date',
|
||||
'shipping_method_id', 'shipping_method_snapshot', 'cif_total_amount', 'domestic_port_id', 'domestic_port_snapshot',
|
||||
'shipping_method_id', 'shipping_method_snapshot', 'domestic_port_id', 'domestic_port_snapshot',
|
||||
'trade_term_id', 'trade_term_snapshot', 'clearance_port_id', 'clearance_port_snapshot',
|
||||
'latest_arrival_date', 'contract_exchange_rate', 'settlement_currency', 'status',
|
||||
'remark', 'created_at', 'updated_at', 'deleted_at',
|
||||
'object_id', 'contract', 'is_use', 'is_final', 'approval_status', 'file_url', 'pick_up_date', 'collect_all_date', 'profit_total'
|
||||
'object_id', 'is_use', 'is_final', 'approval_status', 'file_url', 'pick_up_date', 'collect_all_date', 'profit_total'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -94,6 +94,14 @@ class StockOrders extends Model
|
||||
return $this->hasMany(VehMoneyValue::class, 'object_id', 'id')->where('object_scene', 'stock_orders');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联订单文件附件
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
return $this->hasMany(StockOrdersFiles::class, 'order_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function salesperson()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use support\Model;
|
||||
|
||||
class StockOrdersFiles extends Model
|
||||
{
|
||||
/**
|
||||
* The connection name for the model.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $connection = 'mysql';
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'stock_orders_files';
|
||||
|
||||
/**
|
||||
* 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', 'order_id', 'file_name', 'file_code', 'file_url', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
const CONTRACT = 'contract';
|
||||
const TRANSACTION_SLIP = 'transaction_slip';
|
||||
const PI_DOC = 'pi_doc';
|
||||
|
||||
const FILE_CODE = [
|
||||
self::CONTRACT => '合同',
|
||||
self::TRANSACTION_SLIP => '水单',
|
||||
self::PI_DOC => 'PI',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user