huangjiajun 2 months ago
parent
commit
85aba645c0
1 changed files with 16 additions and 1 deletions
  1. +16
    -1
      app/store/svc/svc_agent_goods.go

+ 16
- 1
app/store/svc/svc_agent_goods.go View File

@@ -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 {


Loading…
Cancel
Save