- 新增客服电话、服务时间、企业微信客服配置项 - 新增客服弹窗组件支持微信在线客服和电话拨打 - 调整核销码为6位数字,修复相关提示文本 - 优化订单服务项目展示逻辑 - 完善抢单大厅加载动画和列表样式
21 行
945 B
PHP
21 行
945 B
PHP
<?php
|
|
namespace app\common\library;
|
|
class OrderServiceSnapshot {
|
|
public static function format(array $goods) {
|
|
if (!empty($goods['addon_services']) && is_string($goods['addon_services'])) {
|
|
return $goods['addon_services'];
|
|
}
|
|
$parts = [];
|
|
if (!empty($goods['service_type_name'])) {
|
|
$parts[] = trim((string)$goods['service_type_name']) . 'x' . max(1, (int)($goods['num'] ?? $goods['goods_num'] ?? 1));
|
|
}
|
|
$extras = !empty($goods['addon_services']) && is_array($goods['addon_services']) ? $goods['addon_services'] : ($goods['extras'] ?? []);
|
|
foreach (is_array($extras) ? $extras : [] as $extra) {
|
|
if (is_array($extra) && !empty($extra['name']) && !empty($extra['num']) && (int)$extra['num'] > 0) {
|
|
$parts[] = trim((string)$extra['name']) . 'x' . (int)$extra['num'];
|
|
}
|
|
}
|
|
return implode(';', $parts);
|
|
}
|
|
}
|