dever vor 3 Jahren
Ursprung
Commit
cc604760a8
1 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen
  1. 10 10
      app/shop/src/My.php

+ 10 - 10
app/shop/src/My.php

@@ -56,33 +56,33 @@ class My extends Core
 	# 我的礼品卡列表
 	public function card()
 	{
-		$this->data = Dever::db('goods/card_code')->select_page(array('uid' => $this->uid));
+		$this->data['card'] = Dever::db('goods/card_code')->select_page(array('uid' => $this->uid));
 
-		if ($this->data) {
+		if ($this->data['card']) {
 			$status = Dever::db('goods/card_code')->config['status'];
 			$time = time();
-			foreach ($this->data as $k => $v) {
+			foreach ($this->data['card'] as $k => $v) {
 
 				if ($v['status'] == 1 && $time > $v['edate']) {
 					$v['status'] = 4;
 					Dever::db('goods/card_code')->update(array('where_id' => $v['id'], 'status' => 4));
 				}
-				$this->data[$k]['status_name'] = $status[$v['status']];
-				$this->data[$k]['edate'] = date('Y-m-d', $v['edate']);
-				$this->data[$k]['goods'] = array();
+				$this->data['card'][$k]['status_name'] = $status[$v['status']];
+				$this->data['card'][$k]['edate'] = date('Y-m-d', $v['edate']);
+				$this->data['card'][$k]['goods'] = array();
 				$info = Dever::db('goods/card')->find($v['card_id']);
 				$goods = Dever::array_decode($info['goods']);
 				foreach ($goods as $k1 => $v1) {
-					$this->data[$k]['goods'][$k1] = Dever::db('goods/info')->find($v1['goods_id']);
-					$this->data[$k]['goods'][$k1]['num'] = $v1['num'];
+					$this->data['card'][$k]['goods'][$k1] = Dever::db('goods/info')->find($v1['goods_id']);
+					$this->data['card'][$k]['goods'][$k1]['num'] = $v1['num'];
 				}
 
 				if (($v['status'] == 2 || $v['status'] == 3) && $v['order_id'] > 0) {
 					# 查找订单
 					$order = Dever::db('shop/sell_order')->find($v['order_id']);
-					$this->data[$k]['order_num'] = $order['order_num'];
+					$this->data['card'][$k]['order_num'] = $order['order_num'];
 				} else {
-					$this->data[$k]['order_num'] = '';
+					$this->data['card'][$k]['order_num'] = '';
 				}
 			}
 		}