From 0f1deb1ef0a280cb1ed52f57a5b09f20d91b5899 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 17 May 2019 13:38:21 +0800 Subject: [PATCH] =?UTF-8?q?Trippest=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=B4=A6=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trippestOrderSync/controllers/TulanduoApi.php | 5 +++++ .../trippestOrderSync/models/orders_model.php | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php index 4c4384e0..ba83d1d4 100644 --- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php +++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php @@ -697,6 +697,11 @@ class TulanduoApi extends CI_Controller $output_text = "Got order operations from TuLanDuo:" . $detail_jsonResp->orderDetail->orderId . ". " . $coli_id; log_message('error', $output_text); echo $output_text; + if (strval($order->isHistory) === '1') { + require_once('order_finance.php'); + $vendor_class = new Order_finance(); + $vendor_class->single_order_report($coli_sn); + } return; } diff --git a/webht/third_party/trippestOrderSync/models/orders_model.php b/webht/third_party/trippestOrderSync/models/orders_model.php index e241900c..e32fbaf3 100644 --- a/webht/third_party/trippestOrderSync/models/orders_model.php +++ b/webht/third_party/trippestOrderSync/models/orders_model.php @@ -176,7 +176,12 @@ class Orders_model extends CI_Model { public function get_groupCombineInfo_finance() { // return array(); // 历史数据已获取完毕 - $to_update_cost_date = date("Y-m-d", strtotime("-45 days")); + // $to_update_cost_date = date("Y-m-d", strtotime("-45 days")); + $to_update_month_begin = date('Y-m-01', strtotime("-4 months", strtotime(date("Y-m-d")))); + $to_update_month_end = date('Y-m-01', strtotime("-3 months", strtotime(date("Y-m-d")))); + $end_d = strtotime($to_update_month_end)-1; + $to_update_month_end = date("Y-m-d 23:59:59", $end_d); + $set_time = date("Y-m-d 00:00:00", strtotime("+50 days",$end_d)); $last_update_time = date("Y-m-d 00:00:00"); $sql = " SELECT top 1 coli.COLI_ID, coli.COLI_SN, coli.COLI_GRI_SN, cold.COLD_SN, coli.COLI_OrderDetailText, coli.COLI_Memo,coli.COLI_State,coli.COLI_OPI_ID, cold.COLD_PlanVEI_SN, cold.COLD_MemoText, gci.*,'1' as 'isHistory' @@ -189,15 +194,15 @@ class Orders_model extends CI_Model { where GCI_combineNo is not null and GCI_combineNo not in ('cancel','forbidden') -- 45天前的订单 - and gci.gci_leaveDate = '$to_update_cost_date' + --and gci.gci_leaveDate = '$to_update_cost_date' -- 今天更新一次 and gci.GCI_createTime < '$last_update_time' -- 已生成账单的不再自动同步 and NOT exists ( select 1 from report_order where ordernumber=COLI_ID and orderstats=1 ) --- and GCI_travelDate between '2018-08-01' and '2018-08-31 23:59:59' --- and gci.GCI_createTime < '2018-12-06 14:00:00' + and GCI_travelDate between '$to_update_month_begin' and '$to_update_month_end' + and gci.GCI_createTime < '$set_time' and GCI_combineNo not like '%取消%' "; $sql .= " ORDER BY isHistory ASC,GCI_createTime ASC ";