From 79c109b81aeae64d1d564ea360cac1184ebbb130 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 12 Jun 2024 10:09:39 +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/db/db_order_goods_make_stock.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/db/db_order_goods_make_stock.go b/app/db/db_order_goods_make_stock.go index 915f2a7..45cbb3e 100644 --- a/app/db/db_order_goods_make_stock.go +++ b/app/db/db_order_goods_make_stock.go @@ -22,6 +22,7 @@ func GetOrderGoodsMakeStockByIpad(eg *xorm.Engine, param map[string]string) (*[] if param["keyword"] != "" { sess.And("goods_title like ?", "%"+param["keyword"]+"%") } + size := utils.StrToInt(param["limit"]) start := (utils.StrToInt(param["page"]) - 1) * size count, err := sess.Limit(size, start).OrderBy("make_date asc,id asc").FindAndCount(&order) @@ -33,8 +34,10 @@ func GetOrderGoodsMakeStockByIpad(eg *xorm.Engine, param map[string]string) (*[] func GetOrderGoodsMakeStockByBigData(eg *xorm.Engine, param map[string]string) (*[]model.OrderGoodsMakeStock, int64) { var order []model.OrderGoodsMakeStock sess := eg.Where("1=1") + goodsSess := eg.Where("state!=5") if param["now"] != "" { sess.And("make_date=?", param["now"]) + goodsSess.And("make_date=?", param["now"]) } if param["state"] == "1" { sess.And("wait_make_num >=0") @@ -50,6 +53,20 @@ func GetOrderGoodsMakeStockByBigData(eg *xorm.Engine, param map[string]string) ( if param["keyword"] != "" { sess.And("goods_title like ?", "%"+param["keyword"]+"%") } + var goodsData []model.OrderGoods + goodsSess.Find(&goodsData) + gids := make([]int64, 0) + skuids := make([]int64, 0) + gids = append(gids, -1) + skuids = append(skuids, -1) + if len(goodsData) > 0 { + for _, v := range goodsData { + gids = append(gids, v.GoodsId) + skuids = append(skuids, v.SkuId) + } + } + sess.In("gid", gids) + sess.In("sku_id", skuids) count, err := sess.OrderBy("id asc").FindAndCount(&order) if err != nil { return nil, count