Authored by Rock Zhang

修复订单列表页product_name不存在时会报错的bug;修复订单详情页快递单号不存在会报错的bug

Code Review By Rock Zhang
... ... @@ -583,7 +583,7 @@ class Helpers
foreach ($orderGoods as $key => $vo) {
$arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
$arr[$key]['name'] = $vo['product_name'];
$arr[$key]['name'] = isset($vo['product_name']) ? $vo['product_name'] : '';
$arr[$key]['color'] = $vo['color_name'];
$arr[$key]['size'] = $vo['size_name'];
$arr[$key]['price'] = $vo['goods_price'];
... ...
... ... @@ -331,13 +331,19 @@ class OrderModel
return $result;
}
/**
* 获取快递有关信息
* @param boolean $showLogistics 是否显示
* @param array $order 订单信息
* @param array $result
*/
private static function assignExpressInfo($showLogistics, $order, &$result)
{
$result['logisticsUrl'] = Helpers::url('/home/logistic', array('order_code' => $order['order_code']));
if ($showLogistics && isset($order['express_company']['caption'])) {
$result['logisticsCompany'] = $order['express_company']['caption'];
$result['logisticsNum'] = $order['express_number'];
$result['logisticsNum'] = isset($order['express_number']) ? $order['express_number'] : '';
}
}
... ...