From 85aba645c08bef0fa71e6a15b7648551d5f35fb7 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 27 Sep 2024 14:07:19 +0800 Subject: [PATCH] 1 --- app/store/svc/svc_agent_goods.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/store/svc/svc_agent_goods.go b/app/store/svc/svc_agent_goods.go index 4d25216..e04ec30 100644 --- a/app/store/svc/svc_agent_goods.go +++ b/app/store/svc/svc_agent_goods.go @@ -10,6 +10,7 @@ import ( "encoding/json" "github.com/gin-gonic/gin" "strings" + "time" ) func AgentGoods(c *gin.Context) { @@ -37,6 +38,18 @@ func AgentGoods(c *gin.Context) { cateMap[v.Id] = v.Title } } + arg["uid"] = utils.IntToStr(user.Info.Uid) + arg["store_type"] = "2" + cateStoreData := db.GetGoodsCateAllArg(svc.MasterDb(c), arg) + cateStoreList := make([]map[string]string, 0) + if cateStoreData != nil { + for _, v := range *cateStoreData { + tmp := map[string]string{ + "name": v.Title, "value": utils.IntToStr(v.Id), + } + cateStoreList = append(cateStoreList, tmp) + } + } if cate != nil { stateMap := []string{"上架", "下架"} scheme, host := svc.ImageBucket(c) @@ -55,7 +68,7 @@ func AgentGoods(c *gin.Context) { } } res := map[string]interface{}{ - "list": list, "total": total, "cate_list": cateList, + "list": list, "total": total, "cate_list": cateList, "store_cate_list": cateStoreList, } e.OutSuc(c, res, nil) return @@ -78,6 +91,8 @@ func AgentGoodsCopy(c *gin.Context) { v.Stock = 0 v.Uid = user.Info.Uid v.StoreType = 1 + v.CreateAt = time.Now() + v.UpdateAt = time.Now() v.Cid = utils.StrToInt(arg["cid"]) _, err := sess.Insert(&v) if err != nil {