|
|
|
@ -283,7 +283,7 @@ class ExpressTplService extends AbstractService {
|
|
|
|
|
|
|
|
|
|
public function changeExpressTplName($mallId, $expressTplId, $tplName) {
|
|
|
|
|
CheckClient::checkAnyEmpty('参数错误', $mallId, $expressTplId, $tplName);
|
|
|
|
|
$affRow = $this->opVenderExpressTplDao->update(
|
|
|
|
|
$affRow = $this->opUserExpressTplDao->update(
|
|
|
|
|
['tplName' => $tplName],
|
|
|
|
|
'op_user_express_tpl_id = %i and `mall_id` = %s',
|
|
|
|
|
$expressTplId, $mallId
|
|
|
|
@ -295,7 +295,7 @@ class ExpressTplService extends AbstractService {
|
|
|
|
|
|
|
|
|
|
public function changeExpressTplPrinter($mallId, $expressTplId, $printer) {
|
|
|
|
|
CheckClient::checkAnyEmpty('参数错误', $mallId, $expressTplId);
|
|
|
|
|
$affRow = $this->opVenderExpressTplDao->update(
|
|
|
|
|
$affRow = $this->opUserExpressTplDao->update(
|
|
|
|
|
['printer' => $printer],
|
|
|
|
|
'op_user_express_tpl_id = %i and `mall_id` = %s',
|
|
|
|
|
$expressTplId, $mallId
|
|
|
|
@ -308,7 +308,7 @@ class ExpressTplService extends AbstractService {
|
|
|
|
|
public function changeExpressTplSenderAddress($mallId, $expressTplId, $senderAddressId) {
|
|
|
|
|
CheckClient::checkAnyEmpty('参数错误', $mallId, $expressTplId);
|
|
|
|
|
|
|
|
|
|
$affRow = $this->opVenderExpressTplDao->update(
|
|
|
|
|
$affRow = $this->opUserExpressTplDao->update(
|
|
|
|
|
['opSenderAddressId' => $senderAddressId],
|
|
|
|
|
'op_user_express_tpl_id = %i and `mall_id` = %s',
|
|
|
|
|
$expressTplId, $mallId
|
|
|
|
@ -737,10 +737,48 @@ class ExpressTplService extends AbstractService {
|
|
|
|
|
'cancelQuantity' => $item['cancel_quantity'],
|
|
|
|
|
'recycledQuantity' => $item['recycled_quantity'],
|
|
|
|
|
'allocatedQuantity' => $item['allocated_quantity'],
|
|
|
|
|
'serviceInfo' => $item['service_info_cols'],
|
|
|
|
|
'serviceList' => $this->buildNetSiteServiceList($item['service_info_cols']),
|
|
|
|
|
'addressList' => $addressList
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
return $netsiteList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildNetSiteServiceList($serviceInfo) {
|
|
|
|
|
$serviceList = [];
|
|
|
|
|
foreach ($serviceInfo as $service) {
|
|
|
|
|
$attributeList = [];
|
|
|
|
|
foreach ($service['service_attributes'] as $attribute) {
|
|
|
|
|
$attributeList[] = [
|
|
|
|
|
'name' => $attribute['attribute_name'],
|
|
|
|
|
'code' => $attribute['attribute_code'],
|
|
|
|
|
'options' => $this->getNetSiteServiceSelectOptions($service['service_code'], $attribute['attribute_code'], $attribute['type_desc']),
|
|
|
|
|
'type' => $attribute['attribute_type'],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
$serviceList[] = [
|
|
|
|
|
'name' => $service['service_name'],
|
|
|
|
|
'code' => $service['service_code'],
|
|
|
|
|
'attributes' => $attributeList,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
return $serviceList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getNetSiteServiceSelectOptions($serviceCode, $attributeCode, $typeDesc) {
|
|
|
|
|
if ($serviceCode == 'TIMED-DELIVERY' && $attributeCode == 'value') {
|
|
|
|
|
return CommonTool::convertMapToOptions(json_decode($typeDesc, true));
|
|
|
|
|
}
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getNetSiteServiceInputType($serviceCode) {
|
|
|
|
|
if (in_array($serviceCode, ['PRODUCT_TYPE', 'TIMED-DELIVERY'])) {
|
|
|
|
|
return 'select';
|
|
|
|
|
} elseif (in_array($serviceCode, ['IN41'])) {
|
|
|
|
|
return 'checkbox';
|
|
|
|
|
} elseif (in_array($serviceCode, ['INSURE', 'IN144'])) {
|
|
|
|
|
return 'input';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|