master
howell 4 years ago
parent 0d50a9d4a7
commit 2b9cdee001

@ -2,12 +2,6 @@ package goods
import (
"fmt"
mysql2 "git.oa00.com/go/mysql"
"github.com/gin-gonic/gin"
"github.com/golangkit/formatime"
"github.com/shopspring/decimal"
gorm2 "gorm.io/gorm"
"gorm.io/gorm/clause"
"recook/internal/back"
"recook/internal/cache"
"recook/internal/dbc"
@ -20,7 +14,15 @@ import (
"recook/internal/v2/model/recook/user"
"recook/tools"
"strconv"
"strings"
"time"
mysql2 "git.oa00.com/go/mysql"
"github.com/gin-gonic/gin"
"github.com/golangkit/formatime"
"github.com/shopspring/decimal"
gorm2 "gorm.io/gorm"
"gorm.io/gorm/clause"
)
type queryOrderGoodsListParam struct {
@ -190,12 +192,6 @@ func QueryGoodsListByComprehension(c *gin.Context) {
}
findByKeyWord(q3, p.Keyword, &goodsList)
//if p.Kind == 0 {
// if len(goodsList) < 20 && p.Page == 0 && p.Keyword != "" {
// goodsList = getFillList(c, goodsList, "")
// }
//}
back.Suc(c, "", GetGoodsRespByInfoList(goodsList, p.UserId))
}
@ -380,15 +376,7 @@ func QueryGoodsListByDiscountPrice(c *gin.Context) {
// GetGoodsRespByInfoList ==============================================================
func GetGoodsRespByInfoList(goodsList []goods.Information, userID uint) []QueryCategoryGoodsListResp {
list := make([]QueryCategoryGoodsListResp, 0, 0)
//新增进口专区国家图标
var iconList []goods2.RecookAbroadCountryModel
dbc.DB.Table((&goods2.RecookAbroadCountryModel{}).TableName()).Find(&iconList)
var countryMap = make(map[uint]string)
countryMap[0] = ""
for _, v := range iconList {
countryMap[v.ID] = v.Icon
}
list := make([]QueryCategoryGoodsListResp, 0)
var u user.RecookUserInfoModel
mysql2.Db.First(&u, "id = ?", userID)
//国家图标放入map结束
@ -398,7 +386,9 @@ func GetGoodsRespByInfoList(goodsList []goods.Information, userID uint) []QueryC
gb := goods.Brand{}
dbc.DB.First(&gb, "id = ?", v.BrandID)
var sku goods.Sku
mysql2.Db.Select("SUM(inventory) AS inventory, "+
mysql2.Db.Select(
"MIN(name), "+
"SUM(inventory) AS inventory, "+
"SUM(sales_volume) AS sales_volume, "+
"MIN(purchase_price) AS purchase_price,"+
"MIN(original_price) AS original_price, "+
@ -464,9 +454,10 @@ func GetGoodsRespByInfoList(goodsList []goods.Information, userID uint) []QueryC
commission = sku.DiscountPrice.Sub(sku.PurchasePrice).Mul(rate)
recookGoodsInfoModel := &goods2.RecookGoodsInfoModel{}
space := " "
list = append(list, QueryCategoryGoodsListResp{
ID: v.ID,
GoodsName: v.GoodsName,
GoodsName: strings.Join([]string{v.GoodsName, strings.Replace(sku.Name, "+", space, -1)},space),
BrandName: gb.Name + "品牌馆",
BrandImg: gb.LogoURL,
BrandId: gb.ID,
@ -489,7 +480,7 @@ func GetGoodsRespByInfoList(goodsList []goods.Information, userID uint) []QueryC
HasCoin: recookGoodsInfoModel.HasCoin(v.Storehouse),
HasBalance: recookGoodsInfoModel.HasBalance(v.Storehouse),
GysId: v.VendorID,
CountryIcon: countryMap[v.Country],
CountryIcon: ,
})
}

@ -1,8 +1,6 @@
package live
import (
"github.com/gin-gonic/gin"
"github.com/shopspring/decimal"
goods2 "recook/internal/api/mobile/goods"
"recook/internal/back"
"recook/internal/dbc"
@ -11,6 +9,9 @@ import (
"recook/internal/model/user"
"recook/tools"
"strconv"
"github.com/gin-gonic/gin"
"github.com/shopspring/decimal"
)
type argsList struct {

@ -31,9 +31,9 @@ var client *sdk.Client
const (
regionId = "cn-hangzhou"
accessKey = "LTAI4Fe9j26vbarEGVZ7Nany"
accessKeySecret = "ysEYgqgpKtPbEJmHwdZ5psKsT15nel"
loginTemplateCode = "SMS_193514959"
accessKey = "LTAI5t8N2GVy5Q8hKLJCvtmd"
accessKeySecret = "Lo5rlllMFuvtrI9voeQaeOk227kkB6"
loginTemplateCode = "SMS_231305089"
)
func init() {

@ -1,12 +1,13 @@
package app
import (
"github.com/gin-gonic/gin"
"recook/internal/api/mobile/bill"
"recook/internal/api/mobile/live"
_ "recook/internal/secure"
"recook/internal/v2/router/middleware"
"github.com/gin-gonic/gin"
"recook/internal/api/mobile/activity"
"recook/internal/api/mobile/addr"
"recook/internal/api/mobile/aftersales"

Loading…
Cancel
Save