fix(order): 增强 Order 模型 getExtAttr 健壮性防数组解析异常
这个提交包含在:
@@ -122,7 +122,11 @@ class Order extends Common
|
|||||||
|
|
||||||
public function getExtAttr($value, $data)
|
public function getExtAttr($value, $data)
|
||||||
{
|
{
|
||||||
$ext = (isset($data['ext']) && $data['ext']) ? json_decode($data['ext'], true) : [];
|
$raw = $data['ext'] ?? $value;
|
||||||
|
$ext = is_array($raw) ? $raw : (json_decode($raw ?? '', true) ?: []);
|
||||||
|
if (!is_array($ext)) {
|
||||||
|
$ext = [];
|
||||||
|
}
|
||||||
|
|
||||||
// 每类活动优惠金额聚合(可能订单购买多个商品,然后同时参与了两种满减,金额累加)
|
// 每类活动优惠金额聚合(可能订单购买多个商品,然后同时参与了两种满减,金额累加)
|
||||||
$ext['promo_discounts'] = [
|
$ext['promo_discounts'] = [
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户