shish 2 tahun lalu
induk
melakukan
c4d5a4465a

+ 19 - 2
app-ghs/controllers/PurchaseOrderController.php

@@ -21,6 +21,8 @@ use Yii;
 class PurchaseOrderController extends BaseController
 class PurchaseOrderController extends BaseController
 {
 {
 
 
+    public $guestAccess = ['detail'];
+
     //打印多联 ssh 2024509
     //打印多联 ssh 2024509
     public function actionPrintPaper()
     public function actionPrintPaper()
     {
     {
@@ -583,8 +585,23 @@ class PurchaseOrderController extends BaseController
     //订单详情
     //订单详情
     public function actionDetail()
     public function actionDetail()
     {
     {
-        $orderSn = Yii::$app->request->get('orderSn', '');
-        $orderData = PurchaseOrderClass::getOrderDetail($orderSn, $this->shopId);
+        $get = Yii::$app->request->get('');
+        $orderSn = $get['orderSn'] ?? '';
+        $salt = $get['salt'] ?? '';
+        $adminId = $this->adminId ?? 0;
+        if (!empty($adminId)) {
+            $orderData = PurchaseOrderClass::getOrderDetail($orderSn, $this->shopId);
+        } else {
+            $info = PurchaseOrderClass::getByCondition(['orderSn' => $orderSn], true);
+            if (empty($info)) {
+                util::fail('没有找到采购单');
+            }
+            if ($info->salt != $salt) {
+                util::fail('不是你的采购单');
+            }
+            $shopId = $info->shopId ?? 0;
+            $orderData = PurchaseOrderClass::getOrderDetail($orderSn, $shopId);
+        }
         util::success($orderData);
         util::success($orderData);
     }
     }
 
 

+ 1 - 1
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -419,7 +419,7 @@ class PurchaseOrderClass extends BaseClass
             $content .= '录入人员:' . $orderInfo['shopAdminName'] . '<BR>';
             $content .= '录入人员:' . $orderInfo['shopAdminName'] . '<BR>';
         }
         }
         $content .= "<BR>";
         $content .= "<BR>";
-        $content .= "<CB>扫码查货位</CB>";
+        $content .= "<CB>扫码查货位</CB>";
         $content .= "<BR>";
         $content .= "<BR>";
         $host = Yii::$app->params['ghsHost'];
         $host = Yii::$app->params['ghsHost'];
         $orderSn = $orderInfo->orderSn ?? '';
         $orderSn = $orderInfo->orderSn ?? '';