mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 05:50:50 +00:00
fix(发票列表): 联系人为空串时回退下单用户资料
?? 只拦 null 拦不住空串,改为 trim 后判空回退
This commit is contained in:
parent
113f68365d
commit
eab07f2f04
@ -95,9 +95,11 @@ class OrderInvoiceServices extends BaseService
|
||||
// 前端契约:列表展示的订单号对应中台 order_no
|
||||
$item['order_id'] = $order['order_no'] ?? '';
|
||||
$item['pay_price'] = $order['pay_price'] ?? 0.00;
|
||||
// 收货人姓名电话优先取订单快照,缺失时回退下单用户资料
|
||||
$item['real_name'] = $contact['name'] ?? ($user['real_name'] ?? ($user['nickname'] ?? ''));
|
||||
$item['user_phone'] = $contact['phone'] ?? ($user['phone'] ?? '');
|
||||
// 收货人姓名电话优先取订单快照,空串需回退下单用户资料(?? 只拦 null,拦不住空串)
|
||||
$contactName = trim((string)($contact['name'] ?? ''));
|
||||
$contactPhone = trim((string)($contact['phone'] ?? ''));
|
||||
$item['real_name'] = $contactName !== '' ? $contactName : trim((string)($user['real_name'] ?? ($user['nickname'] ?? '')));
|
||||
$item['user_phone'] = $contactPhone !== '' ? $contactPhone : trim((string)($user['phone'] ?? ''));
|
||||
$item['status'] = $this->statusToLegacy($order['status_code'] ?? '');
|
||||
$item['refund_status'] = $order['refund_status'] ?? 0;
|
||||
$item['add_time'] = date('Y-m-d H:i:s', $order['add_time'] ?? $item['invoice_add_time'] ?? time());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user