From f067161aa653ebfc54f338068b00461d015af11f Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 5 Jun 2024 11:47:31 +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_list.go | 2 +- app/db/db_order_list.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/db/db_order_goods_list.go b/app/db/db_order_goods_list.go index 2bf7976..eb16bec 100644 --- a/app/db/db_order_goods_list.go +++ b/app/db/db_order_goods_list.go @@ -145,7 +145,7 @@ func GetOrderGoodsList(eg *xorm.Engine, param map[string]string) ([]map[string]s size := utils.StrToInt(param["limit"]) start := (utils.StrToInt(param["page"]) - 1) * size - sql := "SELECT %s FROM order_goods og left join `order` o on o.oid=og.oid where %s order by og.id desc %s" + sql := "SELECT %s FROM order_goods og left join `order` o on o.oid=og.oid where %s order by og.id asc %s" sql1 := fmt.Sprintf(sql, "og.deduct_memo,og.oid,og.goods_id,og.sku_id,og.num,og.price,og.state,og.sku_code,og.goods_title,og.sku,og.success_num,og.memo,og.time,og.admin_id,og.enterprise_id,og.deduct_memo,og.ord_no,og.make_date,o.create_at,o.buy_info,o.buy_phone", where, "limit "+utils.IntToStr(start)+","+utils.IntToStr(size)) sql2 := fmt.Sprintf(sql, "COUNT(*) as count", where, "") nativeString, _ := QueryNativeString(eg, sql2) diff --git a/app/db/db_order_list.go b/app/db/db_order_list.go index 609332f..78aea44 100644 --- a/app/db/db_order_list.go +++ b/app/db/db_order_list.go @@ -91,7 +91,7 @@ func GetOrderList(eg *xorm.Engine, param map[string]string) (*[]model.Order, int } size := utils.StrToInt(param["limit"]) start := (utils.StrToInt(param["page"]) - 1) * size - count, err := sess.Limit(size, start).OrderBy("id desc").FindAndCount(&order) + count, err := sess.Limit(size, start).OrderBy("id asc").FindAndCount(&order) if err != nil { return nil, count }