自动更新成本: 改为45天前,已保存账单的排除

feature/trippest
lyt 7 years ago
parent 5852cd8aa4
commit b9a07068d2

@ -176,7 +176,7 @@ class Orders_model extends CI_Model {
public function get_groupCombineInfo_finance()
{
// return array(); // 历史数据已获取完毕
$to_update_cost_date = date("Y-M-d", strtotime("-7 days"));
$to_update_cost_date = date("Y-m-d", strtotime("-45 days"));
$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'
@ -188,10 +188,14 @@ class Orders_model extends CI_Model {
LEFT JOIN BIZ_ConfirmLineDetail cold ON cold.COLD_COLI_SN=coli.COLI_SN
where
GCI_combineNo is not null and GCI_combineNo not in ('cancel','forbidden')
-- 7天前的订单
-- 45天前的订单
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_combineNo not like '%取消%'

Loading…
Cancel
Save