dever 3 anni fa
parent
commit
0154488551
3 ha cambiato i file con 28 aggiunte e 12 eliminazioni
  1. 1 1
      app/mshop/lib/Feieyun.php
  2. 24 8
      app/mshop/src/Data.php
  3. 3 3
      app/shop/lib/Refund.php

+ 1 - 1
app/mshop/lib/Feieyun.php

@@ -149,7 +149,7 @@ class Feieyun
 			$name = $v5['title'];
 			$price = '¥' . $v5['price'];
 			$num = $v5['num'];
-			$prices = $v5['price']*$v5['num'];
+			$prices = $v5['total'];
 			$kw3 = '';
 			$kw1 = '';
 			$kw2 = '';

+ 24 - 8
app/mshop/src/Data.php

@@ -495,14 +495,20 @@ class Data extends Core
 
         $user = $this->user;
         $goods = array();
+        $tgoods = array();
         foreach ($order['goods'] as $k => $v) {
             $sku = isset($v['info']['sku_name']) ? '-' . $v['info']['sku_name'] : '';
-            $goods[] = array
+            $d  = array
             (
                 'title' => $v['info']['name'] . $sku,
-                'price' => $v['price'],
-                'num' => $v['num'],
+                'price' => '¥' . $v['price'],
+                'num' => 'x' . $v['num'],
+                'total' => '¥' . $v['price']*$v['num'],
             );
+            $goods[] = $d;
+            if ($v['status'] == 3) {
+                $tgoods[] = $d;
+            }
         }
         $content = '--------------'.$main_config['name'].'------------<BR><BR>';
         $content .= '<C>'.$config['method'][$order['method']].'</C><BR>';
@@ -510,9 +516,14 @@ class Data extends Core
         $content .= '门店名称:'.$shop['name'].'<BR>';
         $content .= '制单人:'.$user['name'].'<BR>';
         $content .= '下单时间:'.$order['cdate'].'<BR>';
-        $content .= '完成时间:'.$order['fdate'].'<BR>';
+        if ($order['fdate']) {
+            $content .= '完成时间:'.$order['fdate'].'<BR>';
+        }
+        
+        if ($goods) {
+            $content .= Dever::load('mshop/lib/feieyun')->goods('订单商品', $goods);
+        }
         
-        $content .= Dever::load('mshop/lib/feieyun')->goods('订单商品', $goods);
 
         if ($order['card_code_id']) {
             $card = Dever::db('goods/card_code')->find($order['card_code_id']);
@@ -520,11 +531,16 @@ class Data extends Core
                 $content .= '礼品卡:'.$card['card'].'<BR>';
             }
         }
-        $content .= '优惠:'.$order['coupon_cash'].'<BR>';
+        $content .= '优惠:¥ '.$order['coupon_cash'].'<BR>';
         if (isset($order['ps_info']) && $order['ps_info']) {
-            $content .= '配送费:'.$order['ps_info']['price'].'<BR>';
+            $content .= '配送费:¥ '.$order['ps_info']['price'].'<BR>';
         }
-        $content .= '应付:'.$order['price'].'<BR>';
+        $content .= '应付:¥ '.$order['price'].'<BR>';
+        $content .= '--------------------------------<BR>';
+        $content .= '微信支付:¥ '.$order['price'].'<BR>';
+        $content .= '找零:'.$order['kou_cash'].'<BR>';
+        $content .= '--------------------------------<BR>';
+
         $content .= '送货地点:广州市南沙区xx路xx号<BR>';
         $content .= '联系电话:13888888888888<BR>';
         $content .= '订餐时间:2014-08-08 08:08:08<BR>';

+ 3 - 3
app/shop/lib/Refund.php

@@ -310,12 +310,12 @@ class Refund
         $info = Dever::db($this->goods_table)->find(array('id' => $order_goods_id, 'order_id' => $data['id'], 'status' => 1));
         if ($info) {
         	if (isset($info['coupon_cash']) && $info['coupon_cash']) {
-        		$info['tui_price'] = $info['price'] - $info['coupon_cash'];
+        		$info['tui_price'] = ($info['price'] * $info['num']) - $info['coupon_cash'];
         	} else {
-        		$info['tui_price'] = $info['price'];
+        		$info['tui_price'] = $info['price'] * $info['num'];
         	}
 
-            $info['tui_one_price'] = round($info['tui_price'] / $info['num'], 2);
+            $info['tui_one_price'] = $info['price'];
             $info['goods'] = Dever::db('goods/info')->find($info['goods_id']);
         }
         return $info;