소스 검색

Merge branch 'master' of csk/kmall into master

Scott Chen 7 년 전
부모
커밋
84b647a20c
1개의 변경된 파일30개의 추가작업 그리고 0개의 파일을 삭제
  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)
 			{