huangjiajun 1ヶ月前
コミット
85aba645c0
1個のファイルの変更16行の追加1行の削除
  1. +16
    -1
      app/store/svc/svc_agent_goods.go

+ 16
- 1
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 {


読み込み中…
キャンセル
保存