dever 3 سال پیش
والد
کامیت
82e0296b1d
5فایلهای تغییر یافته به همراه138 افزوده شده و 9 حذف شده
  1. 1 1
      app/mshop/lib/Feieyun.php
  2. 28 6
      app/mshop/src/Data.php
  3. 52 2
      app/mshop/src/Goods.php
  4. 50 0
      app/mshop/src/Out.php
  5. 7 0
      app/shop/lib/Info.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['total'];
+			$prices = '¥' . $v5['total'];
 			$kw3 = '';
 			$kw1 = '';
 			$kw2 = '';

+ 28 - 6
app/mshop/src/Data.php

@@ -532,19 +532,41 @@ class Data extends Core
             }
         }
         $content .= '优惠:¥ '.$order['coupon_cash'].'<BR>';
-        if (isset($order['ps_info']) && $order['ps_info']) {
-            $content .= '配送费:¥ '.$order['ps_info']['price'].'<BR>';
+        if (isset($order['ps_cash']) && $order['ps_cash']) {
+            $content .= '配送费:¥ '.$order['ps_cash'].'<BR>';
         }
         $content .= '应付:¥ '.$order['price'].'<BR>';
         $content .= '--------------------------------<BR>';
         $content .= '微信支付:¥ '.$order['price'].'<BR>';
         $content .= '找零:'.$order['kou_cash'].'<BR>';
+        
+        if ($tgoods) {
+            $content .= Dever::load('mshop/lib/feieyun')->goods('退款商品', $tgoods);
+            $content .= '退款金额:¥ '.$order['coupon_cash'].'<BR>';
+        }
+
         $content .= '--------------------------------<BR>';
 
-        $content .= '送货地点:广州市南沙区xx路xx号<BR>';
-        $content .= '联系电话:13888888888888<BR>';
-        $content .= '订餐时间:2014-08-08 08:08:08<BR>';
-        $content .= '<QR>http://www.feieyun.com</QR>';//把二维码字符串用标签套上即可自动生成二维码
+        if (isset($order['address']) && $order['address']) {
+            $content .= '配送地址<BR>';
+            $content .= $order['address']['contact'] . ',' . $order['address']['mobile'] . '<BR>';
+
+            $area = Dever::load("area/api.string", $order['address']['area']);
+            $content .= $area . $order['address']['address'] . $order['address']['house_number'] . '<BR>';
+            $content .= '--------------------------------<BR>';
+        }
+
+        if ($order['info']) {
+            $content .= '备注:'.$order['info'].'<BR>';
+
+            $content .= '--------------------------------<BR>';
+        }
+        
+
+        $content .= '<C>如遇任何问题请致电客服</C><BR>';
+        $content .= '<C>电话:'.$factory_config['phone'].'</C><BR>';
+        $content .= '<C>'.$main_config['worktime'].'</C><BR>';
+        //$content .= '<QR>http://www.feieyun.com</QR>';//把二维码字符串用标签套上即可自动生成二维码
 
         echo $content;die;
         Dever::load('mshop/lib/feieyun')->printOrder($info['number'], $content, 1);

+ 52 - 2
app/mshop/src/Goods.php

@@ -54,10 +54,10 @@ class Goods extends Core
                 if (isset($v['price_array'])) {
                     $pdf->br()->left($v['name'], 150);
                     foreach ($v['price_array'] as $k1 => $v1) {
-                        $pdf->br()->left('----' . $v1['name'], 150)->right('X' . $v1['total'], 40);
+                        $pdf->br()->left('----' . $v1['name'], 150)->right('x ' . $v1['total'], 40);
                     }
                 } else {
-                    $pdf->br()->left($v['name'], 150)->right('X' . $v['total'], 40);
+                    $pdf->br()->left($v['name'], 150)->right('x ' . $v['total'], 40);
                 }
             }
         }
@@ -77,4 +77,54 @@ class Goods extends Core
 
         $pdf->out('库存清单');
     }
+
+    # 打印
+    public function printer()
+    {
+        $id = Dever::input('printer_id');
+        if (!$id) {
+            Dever::alert('请选择打印机');
+        }
+        $where['id'] = $id;
+        $where['shop_id'] = $this->shop_id;
+        $info = Dever::db('shop/print')->find($where);
+        if (!$info) {
+            Dever::alert('请选择打印机');
+        }
+
+        $manage_config = Dever::db('main/manage_config')->find();
+        $sell_config = Dever::db('main/sell_config')->find();
+        $config = Dever::db('main/config')->find();
+        $data = Dever::load('shop/lib/info')->getGoodsSku($this->shop_id);
+
+        $content = '--------------'.$main_config['name'].'------------<BR><BR>';
+        $content .= '门店名称:'.$this->shop['name'].'<BR>';
+        $content .= '制单人:'.$this->user['name'].'<BR>';
+        $content .= '制单时间:'.date('Y-m-d H:i:s').'<BR>';
+        
+        if ($data) {
+            $orderInfo .= '--------------------------------<BR>';
+            $orderInfo .= '名称                         数量<BR>';
+            foreach ($data as $k => $v) {
+                if (isset($v['price_array'])) {
+                    $orderInfo .= $v['name'] . '     <BR>';
+                    $orderInfo .= '----' . $v1['name'] . '     '.$v['total'].'<BR>';
+                } else {
+                    $orderInfo .= $v['name'] . '     '.$v['total'].'<BR>';
+                }
+            }
+
+            $orderInfo .= '--------------------------------<BR>';
+        }
+
+        $content .= '<C>如遇任何问题请致电客服</C><BR>';
+        $content .= '<C>电话:'.$factory_config['phone'].'</C><BR>';
+        $content .= '<C>'.$main_config['worktime'].'</C><BR>';
+        //$content .= '<QR>http://www.feieyun.com</QR>';//把二维码字符串用标签套上即可自动生成二维码
+
+        echo $content;die;
+        Dever::load('mshop/lib/feieyun')->printOrder($info['number'], $content, 1);
+
+        return 'ok';
+    }
 }

+ 50 - 0
app/mshop/src/Out.php

@@ -107,4 +107,54 @@ class Out extends Core
 
         return Dever::load('mshop/lib/out')->set(1,1)->action($this->shop_id, $this->data['name'], $this->data['num'], $this->data['list'], $this->data['price'], $this->uid, $type, $info);
     }
+
+    # 打印
+    public function printer()
+    {
+        $id = Dever::input('printer_id');
+        if (!$id) {
+            Dever::alert('请选择打印机');
+        }
+        $where['id'] = $id;
+        $where['shop_id'] = $this->shop_id;
+        $info = Dever::db('shop/print')->find($where);
+        if (!$info) {
+            Dever::alert('请选择打印机');
+        }
+
+        $manage_config = Dever::db('main/manage_config')->find();
+        $sell_config = Dever::db('main/sell_config')->find();
+        $config = Dever::db('main/config')->find();
+        $data = $this->view();
+
+        $content = '--------------'.$main_config['name'].'------------<BR><BR>';
+        $content .= '门店名称:'.$this->shop['name'].'<BR>';
+        $content .= '制单人:'.$this->user['name'].'<BR>';
+        $content .= '制单时间:'.date('Y-m-d H:i:s').'<BR>';
+        
+        if ($data) {
+            $orderInfo .= '--------------------------------<BR>';
+            $orderInfo .= '名称                         数量<BR>';
+            foreach ($data as $k => $v) {
+                if (isset($v['price_array'])) {
+                    $orderInfo .= $v['name'] . '     <BR>';
+                    $orderInfo .= '----' . $v1['name'] . '     '.$v['total'].'<BR>';
+                } else {
+                    $orderInfo .= $v['name'] . '     '.$v['total'].'<BR>';
+                }
+            }
+
+            $orderInfo .= '--------------------------------<BR>';
+        }
+
+        $content .= '<C>如遇任何问题请致电客服</C><BR>';
+        $content .= '<C>电话:'.$factory_config['phone'].'</C><BR>';
+        $content .= '<C>'.$main_config['worktime'].'</C><BR>';
+        //$content .= '<QR>http://www.feieyun.com</QR>';//把二维码字符串用标签套上即可自动生成二维码
+
+        echo $content;die;
+        Dever::load('mshop/lib/feieyun')->printOrder($info['number'], $content, 1);
+
+        return 'ok';
+    }
 }

+ 7 - 0
app/shop/lib/Info.php

@@ -197,6 +197,13 @@ class Info
         if ($id) {
             $where .= ' and id = ' . $id;
         }
+
+        $shop_method = Dever::input('method');
+        if ($shop_method == 1) {
+            $where .= ' and method in(1,3)';
+        } elseif ($shop_method == 2) {
+            $where .= ' and method in(2,3)';
+        }
         if ($lng && $lat) {
             $sql = 'select id,name,`desc`,truename,mobile,lng,lat,address,open,worktime,method,gotime,city,area,province,county,town,coupon_city,pdesc,license,food_license,jy_license,license_number,company_name,round((st_distance(point(lng, lat), point('.$lng.', '.$lat.'))*111195)/1000, 2) as distance from {table} where '.$where.' order by distance asc';