rabin 2 years ago
parent
commit
eca340b978
2 changed files with 7 additions and 8 deletions
  1. 6 6
      service/agent/lib/Member_set.php
  2. 1 2
      service/agent/lib/Order.php

+ 6 - 6
service/agent/lib/Member_set.php

@@ -103,7 +103,7 @@ class Member_set
                     $name = $card['name'];
                     if ($sku_id == -1) {
                         if ($card['create_type'] == 2) {
-                            $cash = $price = $card['price'] * $total;
+                            $cash = $price = $card['value'] * $total;
                             $total = 1;
                             $w['sku_id'] = Dever::load('card/lib/code')->create($card, 2, $mid, -1, $cash);
                             if (!$w['sku_id']) {
@@ -111,9 +111,9 @@ class Member_set
                             }
                         } else {
                             if ($card['create_type'] == 3 && isset($v['price']) && $v['price'] > 0) {
-                                $card['price'] = $v['price'];
+                                $card['value'] = $v['price'];
                             }
-                            $cash = $price = $card['price'];
+                            $cash = $price = $card['value'];
                             for($i=0; $i<$total;$i++) {
                                 $w['sku_id'] = Dever::load('card/lib/code')->create($card, 2, $mid, -1, $cash);
                                 if ($w['sku_id']) {
@@ -146,7 +146,7 @@ class Member_set
                         
                         if ($total > 0) {
                             if ($card['create_type'] == 2) {
-                                $cash = $price = $card['price'] * $total;
+                                $cash = $price = $card['value'] * $total;
                                 $total = 1;
                                 $w['sku_id'] = Dever::load('card/lib/code')->create($card, 2, $mid, -1, $cash);
                                 if (!$w['sku_id']) {
@@ -154,9 +154,9 @@ class Member_set
                                 }
                             } else {
                                 if ($card['create_type'] == 3 && isset($v['price']) && $v['price'] > 0) {
-                                    $card['price'] = $v['price'];
+                                    $card['value'] = $v['price'];
                                 }
-                                $cash = $price = $card['price'];
+                                $cash = $price = $card['value'];
                                 for($i=0; $i<$total;$i++) {
                                     $w['sku_id'] = Dever::load('card/lib/code')->create($card, 2, $mid, -1, $cash);
                                     if ($w['sku_id']) {

+ 1 - 2
service/agent/lib/Order.php

@@ -1310,14 +1310,13 @@ class Order
                     $table['body'][] = array('商品', $goods_info['name'] . $sku, $goods_info['price'], $v['num']);
                 } elseif ($v['type'] == 2) {
                     $card = Dever::db('card/info')->find($v['type_id']);
-                    $card['price'] = $card['value'];
                     if ($card['create_type'] == 3) {
                         $v['num'] = $v['num'] . '%';
                     } else {
                         $v['num'] = $v['num'] * $t;
                     }
                     
-                    $table['body'][] = array('电子券', $card['name'], $card['price'], $v['num']);
+                    $table['body'][] = array('电子券', $card['name'], $card['value'], $v['num']);
                 } elseif ($v['type'] == 3) {
                     $prize = Dever::db('setting/prize')->find($v['type_id']);
                     $v['num'] = $v['num'] * $t;