- 迁移:courier_freight_rows 增加 express_no / barcode / shop_name(可空) - 导入器支持可选列(快递单号 / 条形码 / 店铺名称),老文件缺这三列也能导;XlsxSheetReader 支持可选列表头 - 页面与导出新增三列;运费差 / 结算运费 / 其他附加费汇总 / 退件费 表头与取数逻辑不变 - 测试:新增新列导入、老文件兼容、页面展示用例
49 lines
1.0 KiB
PHP
49 lines
1.0 KiB
PHP
<?php
|
||
|
||
namespace App\Models\Business;
|
||
|
||
use App\Abstracts\Model;
|
||
|
||
/**
|
||
* 财务经营报表 › 快递运费(来源:快递方提供的成本运费明细导入)。
|
||
*/
|
||
class CourierFreightRow extends Model
|
||
{
|
||
protected $table = 'courier_freight_rows';
|
||
|
||
protected $fillable = [
|
||
'company_id',
|
||
'source',
|
||
'part',
|
||
'transaction_no',
|
||
'express_no',
|
||
'barcode',
|
||
'shop_name',
|
||
'freight_amount',
|
||
];
|
||
|
||
protected $casts = [
|
||
'freight_amount' => 'decimal:4',
|
||
];
|
||
|
||
public static function columnLabels(): array
|
||
{
|
||
return [
|
||
'source' => '来源',
|
||
'part' => '成品配件',
|
||
'transaction_no' => '交易单号',
|
||
'express_no' => '快递单号',
|
||
'barcode' => '条形码',
|
||
'shop_name' => '店铺名称',
|
||
'freight_amount' => '提供成本运费',
|
||
];
|
||
}
|
||
|
||
public static function fieldTypes(): array
|
||
{
|
||
return [
|
||
'freight_amount' => 'currency',
|
||
];
|
||
}
|
||
}
|