From 0836d665aa204974cabfcab252d227a1c504ffd3 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 28 May 2024 17:10:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/svc/order/svc_order_pay.go | 7 +++++++ app/bigData/hdl/hdl_making_data.go | 3 ++- app/bigData/svc/svc_data.go | 7 ++----- app/bigData/svc/svc_making_data.go | 2 +- app/db/db_order_goods_list.go | 2 +- app/ipad/md/md_order.go | 1 - 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/admin/svc/order/svc_order_pay.go b/app/admin/svc/order/svc_order_pay.go index 5355284..06c2498 100644 --- a/app/admin/svc/order/svc_order_pay.go +++ b/app/admin/svc/order/svc_order_pay.go @@ -43,6 +43,13 @@ func GoodsPayCreate(c *gin.Context) { sess := db.Db.NewSession() defer sess.Close() sess.Begin() + sysCfgDb := db.SysCfgDb{} + sysCfgDb.Set() + beforeHourShowOrder, _ := sysCfgDb.SysCfgGetOne("before_hour_show_order") + if utils.StrToInt(beforeHourShowOrder.Val) > time.Now().Hour() { + e.OutErr(c, 400, e.NewErr(400, "请"+beforeHourShowOrder.Val+"点后再下单")) + return + } today := utils.GetTimeRange("today") count, _ := sess.Where("create_at>=?", time.Unix(today["start"], 0).Format("2006-01-02 15:04:05")).Count(&model.Order{}) i := utils.IntToStr(int(count + 1)) diff --git a/app/bigData/hdl/hdl_making_data.go b/app/bigData/hdl/hdl_making_data.go index 8e496bf..241089c 100644 --- a/app/bigData/hdl/hdl_making_data.go +++ b/app/bigData/hdl/hdl_making_data.go @@ -80,7 +80,8 @@ func NewOrderNotice(c *gin.Context) { } func NewOrderInfoNotice(c *gin.Context) { var data []model.OrderGoods - db.Db.Where("is_new=1").Find(&data) + now := svc.CommDate() + db.Db.Where("is_new=1 and make_date=?", now).Find(&data) sysCfgDb := db.SysCfgDb{} sysCfgDb.Set() cfg, _ := sysCfgDb.SysCfgGetOne("new_order_notice") diff --git a/app/bigData/svc/svc_data.go b/app/bigData/svc/svc_data.go index 93f829d..43856af 100644 --- a/app/bigData/svc/svc_data.go +++ b/app/bigData/svc/svc_data.go @@ -464,12 +464,9 @@ func NewSortingData(c *gin.Context) []map[string]string { } //1、查找不等于4 5 - today := utils.GetTimeRange("today") - if time.Now().Hour() < 2 { - today = utils.GetTimeRange("yesterday") - } + now := CommDate() var orders []model.Order - err = engine.Where(" state != 4 and state != 5 and create_at>=? and enterprise_id=?", time.Unix(today["start"], 0).Format("2006-01-02 15:04:05"), args["id"]).Find(&orders) + err = engine.Where(" state != 4 and state != 5 and make_date=? and enterprise_id=?", now, args["id"]).Find(&orders) if err != nil { return res } diff --git a/app/bigData/svc/svc_making_data.go b/app/bigData/svc/svc_making_data.go index 67c276e..93917ed 100644 --- a/app/bigData/svc/svc_making_data.go +++ b/app/bigData/svc/svc_making_data.go @@ -37,7 +37,7 @@ func CommMakingData(c *gin.Context, args map[string]string) { tmp["state_str"] = "无需制作" } if v.GoodsType == 1 { //判断主单做完了就显示完成 - count, _ := eg.Where("gid=? and sku_id=? and goods_type=0 and make_date=?", v.Gid, v.SkuId, v.MakeDate).Count(&model.OrderGoodsMakeStock{}) + count, _ := eg.Where("gid=? and sku_id=? and goods_type=0 and make_date=?", v.Gid, v.SkuId, v.MakeDate).Sum(&model.OrderGoodsMakeStock{}, "wait_make_num") if count == 0 { tmp["state"] = "4" tmp["state_str"] = "制作完成" diff --git a/app/db/db_order_goods_list.go b/app/db/db_order_goods_list.go index 64470fd..c5981b2 100644 --- a/app/db/db_order_goods_list.go +++ b/app/db/db_order_goods_list.go @@ -8,7 +8,7 @@ import ( func GetOrderGoodsListByIpad(eg *xorm.Engine, param map[string]string) (*[]model.OrderGoods, int64) { var order []model.OrderGoods - sess := eg.Where("state!=5 ") + sess := eg.Where("state!=5 and goods_type=0") if param["sorting"] == "1" { sess.And("state!=4") } diff --git a/app/ipad/md/md_order.go b/app/ipad/md/md_order.go index 2ad4614..f602d1f 100644 --- a/app/ipad/md/md_order.go +++ b/app/ipad/md/md_order.go @@ -7,7 +7,6 @@ type OrderSorting struct { } type NewOrderSorting struct { Gid string `json:"gid"` - Id string `json:"id"` SkuId string `json:"sku_id"` AdminId string `json:"admin_id"` OrderInfo []map[string]string `json:"goods_info"`