From dfe1a291d3c9d827d3e8d705770219a893b7a933 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 5 Nov 2024 11:29:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=BB=93=E7=AE=97=E5=8D=95=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/task/svc/svc_agent_settlement_state.go | 6 +++--- app/task/svc/svc_medium_settlement_state.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/task/svc/svc_agent_settlement_state.go b/app/task/svc/svc_agent_settlement_state.go index d3a2a20..9dca31e 100644 --- a/app/task/svc/svc_agent_settlement_state.go +++ b/app/task/svc/svc_agent_settlement_state.go @@ -46,7 +46,7 @@ func AgentSettlementState(eg *xorm.Engine) { //1、查询"日结"结算单 agent_settlement 数据 _, err := eg.Where("kind = ?", 1).And("start_date != ?", today).Update(&model2.AgentSettlement{ State: 1, //结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) - EndDate: today, + EndDate: now.AddDate(0, 0, -1).Format("2006-01-02"), }) if err != nil { fmt.Println("err>>>>>>>", err.Error()) @@ -58,7 +58,7 @@ func AgentSettlementState(eg *xorm.Engine) { if weekday == time.Monday { _, err = eg.Where("kind = ?", 2).And("start_date != ?", today).Update(&model2.AgentSettlement{ State: 1, //结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) - EndDate: today, + EndDate: now.AddDate(0, 0, -1).Format("2006-01-02"), }) if err != nil { fmt.Println("err>>>>>>>", err.Error()) @@ -70,7 +70,7 @@ func AgentSettlementState(eg *xorm.Engine) { if now.Day() == 1 { _, err = eg.Where("kind = ?", 3).And("start_date != ?", today).Update(&model2.AgentSettlement{ State: 1, //结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) - EndDate: today, + EndDate: now.AddDate(0, 0, -1).Format("2006-01-02"), }) if err != nil { fmt.Println("err>>>>>>>", err.Error()) diff --git a/app/task/svc/svc_medium_settlement_state.go b/app/task/svc/svc_medium_settlement_state.go index 7e75e86..6f226f5 100644 --- a/app/task/svc/svc_medium_settlement_state.go +++ b/app/task/svc/svc_medium_settlement_state.go @@ -46,7 +46,7 @@ func MediumSettlementState(eg *xorm.Engine) { //1、查询"日结"结算单 medium_settlement 数据 _, err := eg.Where("kind = ?", 1).And("start_date != ?", today).Update(&model2.MediumSettlement{ State: 1, //结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) - EndDate: today, + EndDate: now.AddDate(0, 0, -1).Format("2006-01-02"), }) if err != nil { fmt.Println("err>>>>>>>", err.Error()) @@ -58,7 +58,7 @@ func MediumSettlementState(eg *xorm.Engine) { if weekday == time.Monday { _, err = eg.Where("kind = ?", 2).And("start_date != ?", today).Update(&model2.MediumSettlement{ State: 1, //结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) - EndDate: today, + EndDate: now.AddDate(0, 0, -1).Format("2006-01-02"), }) if err != nil { fmt.Println("err>>>>>>>", err.Error()) @@ -70,7 +70,7 @@ func MediumSettlementState(eg *xorm.Engine) { if now.Day() == 1 { _, err = eg.Where("kind = ?", 3).And("start_date != ?", today).Update(&model2.MediumSettlement{ State: 1, //结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订) - EndDate: today, + EndDate: now.AddDate(0, 0, -1).Format("2006-01-02"), }) if err != nil { fmt.Println("err>>>>>>>", err.Error())