Jelajahi Sumber

打印问题

shish 2 tahun lalu
induk
melakukan
9c3360e8fd
1 mengubah file dengan 14 tambahan dan 2 penghapusan
  1. 14 2
      app-hd/controllers/NoticeController.php

+ 14 - 2
app-hd/controllers/NoticeController.php

@@ -85,8 +85,14 @@ class NoticeController extends PublicController
                     if (!empty($order)) {
                         //订单生成时唤起在线打印
                         if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'need')) {
-                            if (isset($order->mainId) == true && $order->mainId == 10536) {
+                            if (getenv('YII_ENV') == 'production') {
                                 //源花汇不自动打开小票
+                                $mallOrderNoPrint = [10536];
+                            } else {
+                                $mallOrderNoPrint = [644];
+                            }
+                            if (in_array($order->mainId, $mallOrderNoPrint)) {
+
                             } else {
                                 OrderClass::onlinePrint($order);
                                 $order->printNum += 1;
@@ -297,8 +303,14 @@ class NoticeController extends PublicController
                         if (!empty($order)) {
                             //订单生成时唤起在线打印
                             if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'need')) {
-                                if (isset($order->mainId) == true && $order->mainId == 10536) {
+                                if (getenv('YII_ENV') == 'production') {
                                     //源花汇不自动打开小票
+                                    $mallOrderNoPrint = [10536];
+                                } else {
+                                    $mallOrderNoPrint = [644];
+                                }
+                                if (in_array($order->mainId, $mallOrderNoPrint)) {
+
                                 } else {
                                     OrderClass::onlinePrint($order);
                                     $order->printNum += 1;