|
|
@@ -26,7 +26,7 @@ class ShippingTemplateRelationEntity extends BaseEntity
|
|
|
/**
|
|
|
* 为业务实体设置运费模板
|
|
|
*/
|
|
|
- public function setTemplateForBiz(int $templateId, string $bizType, int $bizId): bool
|
|
|
+ public function setTemplateForBiz(int $templateId, int $bizId, string $bizType = 'goods'): bool
|
|
|
{
|
|
|
$relation = $this->where('biz_type', $bizType)
|
|
|
->where('biz_id', $bizId)
|
|
|
@@ -36,7 +36,6 @@ class ShippingTemplateRelationEntity extends BaseEntity
|
|
|
// 更新已存在的关联
|
|
|
return $relation->save([
|
|
|
'template_id' => $templateId,
|
|
|
- 'update_time' => date('Y-m-d H:i:s')
|
|
|
]);
|
|
|
} else {
|
|
|
// 创建新的关联
|
|
|
@@ -44,8 +43,6 @@ class ShippingTemplateRelationEntity extends BaseEntity
|
|
|
'template_id' => $templateId,
|
|
|
'biz_type' => $bizType,
|
|
|
'biz_id' => $bizId,
|
|
|
- 'create_time' => date('Y-m-d H:i:s'),
|
|
|
- 'update_time' => date('Y-m-d H:i:s')
|
|
|
]);
|
|
|
}
|
|
|
}
|