|
@@ -723,6 +723,9 @@ class order_base
|
|
|
$goods_spec = '';
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ $val = unserialize($goods_spec);
|
|
|
+ }
|
|
|
|
|
|
return $goods_spec;
|
|
|
}
|
|
@@ -1051,12 +1054,29 @@ class vorder_helper extends order_base
|
|
|
|
|
|
public function format()
|
|
|
{
|
|
|
+ $gids = [];
|
|
|
+ foreach ($this->mOrders as $order) {
|
|
|
+ $gid = intval($order['goods_id']);
|
|
|
+ $gids[] = $gid;
|
|
|
+ }
|
|
|
+ $helper = new goods_helper(new bonus\normal_calc());
|
|
|
+ $items = $helper->order_goods($gids);
|
|
|
+
|
|
|
+ $all_goods = [];
|
|
|
+ foreach ($items as $item) {
|
|
|
+ $gid = intval($item['goods_id']);
|
|
|
+ $all_goods[$gid] = $item;
|
|
|
+ }
|
|
|
+
|
|
|
$result = [];
|
|
|
foreach ($this->mOrders as $order)
|
|
|
{
|
|
|
+ $gid = intval($order['goods_id']);
|
|
|
+ $goods = $all_goods[$gid];
|
|
|
+
|
|
|
$item['vorder_info'] = $this->order_info($order);
|
|
|
$item['actions'] = $this->actions($order);
|
|
|
- $item['vorder_goods'] = $this->order_goods($order);
|
|
|
+ $item['vorder_goods'] = $this->order_goods($order,$goods);
|
|
|
if(empty($item['vorder_info']) || empty($item['vorder_goods'])) {
|
|
|
continue;
|
|
|
}
|
|
@@ -1076,7 +1096,7 @@ class vorder_helper extends order_base
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
- private function order_goods($order)
|
|
|
+ private function order_goods($order,$goods_info)
|
|
|
{
|
|
|
$result = [];
|
|
|
|
|
@@ -1090,6 +1110,7 @@ class vorder_helper extends order_base
|
|
|
return false;
|
|
|
}
|
|
|
$goods["goods_commonid"] = $commonid;
|
|
|
+
|
|
|
$goods["goods_name"] = $val["goods_name"];
|
|
|
$goods["goods_price"] = doubleval($val["goods_price"]);
|
|
|
$goods["goods_num"] = intval($val["goods_num"]);
|
|
@@ -1102,7 +1123,7 @@ class vorder_helper extends order_base
|
|
|
|
|
|
$goods["promotions_id"] = intval($val["promotions_id"]);
|
|
|
$goods["gc_id"] = intval($val["gc_id"]);
|
|
|
- $goods["goods_spec"] = $this->goods_spec($val["goods_spec"],$val["goods_name"]);
|
|
|
+ $goods["goods_spec"] = $this->goods_spec($goods_info["goods_spec"],$val["goods_name"]);
|
|
|
$goods["refund"] = isset($val["refund"]) ? intval($val["refund"]) : 0;
|
|
|
|
|
|
$refund_state = 0;
|