Parcourir la source

增加海关三单推单表,记录通关标识

project il y a 7 ans
Parent
commit
5b2f5c7a43
1 fichiers modifiés avec 30 ajouts et 0 suppressions
  1. 30 0
      src/classes/order_class.php

+ 30 - 0
src/classes/order_class.php

@@ -181,6 +181,36 @@ class Order_Class
 			$collectionDocObj->setData($collectionData);
 			$collectionDocObj->add();
 
+
+			//add by Scott Chen on 2017-11-04
+            //初始化发送海关三单标识数据
+            $orderCusDB = new Imodel('order_cus');
+            //是否已经存在可用订单
+            $orderCusRow = $orderCusDB->getObj('order_no = "' . $orderNo . '"');
+            if (empty($orderCusRow)) {
+                //不存在,则新增
+                $addCusArray = array(
+                    'order_no' => $orderNo,
+                    'cus_order_flag'  => '0',
+                    'cus_waybill_flag'  => '0',
+                    'cus_pay_bill_flag'   => '0',
+                    'is_valid'   => '1',
+                );
+                $orderCusDB->setData($addCusArray);
+                $orderCusDB->add();
+            }else if ($orderCusRow['order_no']) {
+                //已经存在对应订单的海关推单标识
+                //强制更新可用状态为‘可用’
+                $updateCusArray = array(
+                    'is_valid'   => '1'
+                );
+                $orderCusDB->setData($updateCusArray);
+                $orderCusDB->update('order_no="' . $orderNo . '"');
+            }
+
+
+
+
 			//促销活动订单
 			if($orderRow['type'] != 0)
 			{