Browse Source

更新

master
huangjiajun 5 months ago
parent
commit
fbc112083a
2 changed files with 4 additions and 13 deletions
  1. +1
    -1
      app/admin/svc/order/svc_order_list.go
  2. +3
    -12
      app/db/db_order_goods_list.go

+ 1
- 1
app/admin/svc/order/svc_order_list.go View File

@@ -160,7 +160,7 @@ func NewOrderGoodsList(c *gin.Context) {
return return
} }
eg := db.Db eg := db.Db
list, _ := db.GetOrderGoodsList(eg, args)
list, _ := db.GetOutputOrderGoodsList(eg, args)
xlsx, _ := excelize.OpenFile("./static/template/综合订单品类明细表.xlsx") xlsx, _ := excelize.OpenFile("./static/template/综合订单品类明细表.xlsx")


data := make([]map[string]interface{}, 0) data := make([]map[string]interface{}, 0)


+ 3
- 12
app/db/db_order_goods_list.go View File

@@ -211,18 +211,9 @@ func GetOutputOrderGoodsList(eg *xorm.Engine, param map[string]string) ([]map[st
} }
where += " and o.enterprise_id in(" + php2go.Implode(",", oids) + ")" where += " and o.enterprise_id in(" + php2go.Implode(",", oids) + ")"
} }
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 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)
count := 0
for _, v := range nativeString {
count = utils.StrToInt(v["count"])
}
sql := "SELECT %s FROM order_goods og left join `order` o on o.oid=og.oid where %s order by og.id asc "
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)
nativeString1, _ := QueryNativeString(eg, sql1) nativeString1, _ := QueryNativeString(eg, sql1)

return nativeString1, int64(count)
return nativeString1, 0
} }

Loading…
Cancel
Save