From c00453c571ae0df63f28778077ccdaa98e3dc524 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 28 Mar 2024 16:38:28 +0800 Subject: [PATCH] =?UTF-8?q?1.ipad=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/db_order_goods_doing.go | 14 +++++++------- app/db/db_order_list.go | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/db/db_order_goods_doing.go b/app/db/db_order_goods_doing.go index fb0ba20..94d312f 100644 --- a/app/db/db_order_goods_doing.go +++ b/app/db/db_order_goods_doing.go @@ -17,14 +17,14 @@ func GetOrderGoodsByRecordId(eg *xorm.Engine, id string) *model.OrderGoodsDoing func GetOrderGoodsDoingList(eg *xorm.Engine, param map[string]string) (*[]model.OrderGoodsDoing, int64) { var order []model.OrderGoodsDoing sess := eg.Where("1=1") - if param["enterprise_name"] != "" { - var data []model.Enterprise - eg.Where("name like ?", "%"+param["enterprise_name"]+"%") + if param["admin_name"] != "" { + var data []model.Admin + eg.Where("memo like ?", "%"+param["admin_name"]+"%") ids := []int{-1} for _, v := range data { - ids = append(ids, v.Id) + ids = append(ids, v.AdmId) } - sess.In("enterprise_id", ids) + sess.In("admin_id", ids) } if param["oid"] != "" { sess.And("oid like ?", "%"+param["oid"]+"%") @@ -32,8 +32,8 @@ func GetOrderGoodsDoingList(eg *xorm.Engine, param map[string]string) (*[]model. if param["state"] != "" { sess.And("state =?", param["state"]) } - if param["admin_id"] != "" { - sess.And("admin_id =?", param["admin_id"]) + if param["enterprise_id"] != "" { + sess.And("enterprise_id =?", param["enterprise_id"]) } if param["goods_title"] != "" { sess.And("goods_title like ?", "%"+param["goods_title"]+"%") diff --git a/app/db/db_order_list.go b/app/db/db_order_list.go index 5ff66f1..6b87346 100644 --- a/app/db/db_order_list.go +++ b/app/db/db_order_list.go @@ -52,14 +52,14 @@ func GetOrderList(eg *xorm.Engine, param map[string]string) (*[]model.Order, int if param["state"] != "" { sess.And("state =?", param["state"]) } - if param["goods_title"] != "" { - var orderGoods []model.OrderGoods - eg.Where("goods_title like ?", "%"+param["goods_title"]+"%").Find(&orderGoods) - oids := []int64{-1} - for _, v := range orderGoods { - oids = append(oids, v.Oid) + if param["enterprise_name"] != "" { + var enterprise []model.Enterprise + eg.Where("name like ?", "%"+param["enterprise_name"]+"%").Find(&enterprise) + oids := []int{-1} + for _, v := range enterprise { + oids = append(oids, v.Id) } - sess.In("oid", oids) + sess.In("enterprise_id", oids) } size := utils.StrToInt(param["limit"]) start := (utils.StrToInt(param["page"]) - 1) * size