85 lines
3.1 KiB
PHP
85 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Business;
|
|
|
|
use App\Abstracts\Model;
|
|
|
|
/**
|
|
* 快递资料在财务系统里的「编辑」覆盖值(按快递公司代码)。工作平台镜像只读,编辑结果存在这里,
|
|
* 页面和导出显示时用覆盖值盖在镜像值上。
|
|
*/
|
|
class CourierProfile extends Model
|
|
{
|
|
/** 钉钉后续节点填写的发货资料;网点代码沿用入驻表的 network_code。 */
|
|
public const SHIPPING_FIELDS = [
|
|
'shipper_name' => '发货人',
|
|
'shipping_address' => '发货地址',
|
|
];
|
|
|
|
/** 可在财务系统编辑的快递资料字段,含工作平台列及内部发货资料。 */
|
|
public const EDITABLE = [
|
|
'expname' => '快递公司名称',
|
|
'exp_properties' => '快递属性',
|
|
'outcode' => '外部编码',
|
|
'scexpcode' => '杉橙快递代码',
|
|
'paymethod' => '运费打款方式',
|
|
'status' => '是否启用',
|
|
'addvalidsgn' => '可达服务',
|
|
'kuaiyunsgn' => '是否快运',
|
|
'autonosgn' => '自动寻号',
|
|
'packnosgn' => '配货单号寻号',
|
|
'skucountsplitsgn' => '数量拆单',
|
|
'weight0sgn' => '重量0寻号',
|
|
'stopdate' => '停运时间',
|
|
'tradebody' => '合同主体',
|
|
'tradebtime' => '合同开始时间',
|
|
'tradeetime' => '合同结束时间',
|
|
'signcom' => '签订公司',
|
|
'linker' => '联系人',
|
|
'linkmobile' => '联系电话',
|
|
'undefined1' => '自定义1',
|
|
'undefined2' => '自定义2',
|
|
'undefined3' => '扣款方式',
|
|
'dzqzjbr' => '电子签章经办人',
|
|
'volume0sgn' => '体积0寻号',
|
|
'handnosgn' => '手工单号',
|
|
'decryptsgn' => '解密',
|
|
...self::SHIPPING_FIELDS,
|
|
'entity_type' => '入驻主体类型',
|
|
'company_full_name' => '入驻主体名称',
|
|
'courier_category' => '快递类型',
|
|
'cooperation_mode' => '快递合作方式',
|
|
'courier_attribute' => '入驻快递属性',
|
|
'waybill_type' => '单号类型',
|
|
'shipping_mode' => '快递发货方式',
|
|
'need_logistics_check' => '是否需要核对物流点',
|
|
'workplatform_account' => '是否已有工作平台账号',
|
|
'courier_email' => '快递邮箱',
|
|
'network_code' => '网点代码',
|
|
'network_region' => '网点所在地区',
|
|
];
|
|
|
|
public const BOOLEAN_FIELDS = [
|
|
'status', 'addvalidsgn', 'kuaiyunsgn', 'autonosgn', 'packnosgn',
|
|
'skucountsplitsgn', 'weight0sgn', 'volume0sgn', 'handnosgn', 'decryptsgn',
|
|
];
|
|
public const DATE_FIELDS = ['stopdate', 'tradebtime', 'tradeetime'];
|
|
|
|
public static function fieldOptions(string $field): ?array
|
|
{
|
|
if ($field === 'entity_type') {
|
|
return CourierOnboarding::ENTITY_TYPES;
|
|
}
|
|
|
|
$options = CourierOnboarding::PROFILE_FIELDS[$field][1] ?? null;
|
|
|
|
return $options === null ? null : array_combine($options, $options);
|
|
}
|
|
|
|
protected $table = 'business_courier_profiles';
|
|
|
|
protected $fillable = ['company_id', 'expcode', 'courier_name', 'overrides', 'created_by', 'updated_by'];
|
|
|
|
protected $casts = ['overrides' => 'array'];
|
|
}
|