解决办法:
找到文件 app/services/order/StoreOrderDeliveryServices.php
在最后加上这段代码 (最后一个}里)
/**
* 返回订单商品总重量
* @param int $id
* @return int|string
*/
public function getOrderSumWeight(int $id, $default = false)
{
/** @var StoreOrderCartInfoServices $services */
$services = app()->make(StoreOrderCartInfoServices::class);
$orderGoodInfo = $services->getOrderCartInfo((int)$id);
$weight = 0;
foreach ($orderGoodInfo as $cartInfo) {
$cart = $cartInfo['cart_info'] ?? [];
if ($cart) {
$weight = bcadd((string)$weight, (string)bcmul((string)$cart['cart_num'] ?? '0', (string)$cart['productInfo']['attrInfo']['weight'] ?? '0', 4), 2);
}
}
return $weight ? $weight : ($default === false ? 0 : $default);
}
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}