|
@@ -7,6 +7,7 @@ import (
|
|
"fmt"
|
|
"fmt"
|
|
"github.com/issue9/conv"
|
|
"github.com/issue9/conv"
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/sirupsen/logrus"
|
|
|
|
+ "github.com/tidwall/gjson"
|
|
"gorm.io/gorm"
|
|
"gorm.io/gorm"
|
|
"reflect"
|
|
"reflect"
|
|
"strings"
|
|
"strings"
|
|
@@ -129,6 +130,19 @@ func GetSelectionList(ctx context.Context, enterpriseID string, pageSize, pageNu
|
|
var newSelectionInfos []*gorm_model.YounggeeSelectionInfo
|
|
var newSelectionInfos []*gorm_model.YounggeeSelectionInfo
|
|
for _, v := range selectionInfos {
|
|
for _, v := range selectionInfos {
|
|
fmt.Printf("查询选品列表 %+v\n", v)
|
|
fmt.Printf("查询选品列表 %+v\n", v)
|
|
|
|
+ //v.ProductSnap = conv.MustString(gjson.Get(v.ProductSnap, "ProductName"), "") + " " + conv.MustString(gjson.Get(v.ProductSnap, "ProductPrice"), "")
|
|
|
|
+ kuaiShouProductInfo := map[string]interface{}{
|
|
|
|
+ "ProductName": conv.MustString(gjson.Get(v.ProductSnap, "ProductName")),
|
|
|
|
+ "ProductPrice": conv.MustString(gjson.Get(v.ProductSnap, "ProductPrice")),
|
|
|
|
+ }
|
|
|
|
+ //kuaiShouProductInfo["ProductName"] = conv.MustString(gjson.Get(v.ProductSnap, "ProductName"))
|
|
|
|
+ //kuaiShouProductInfo["ProductPrice"] = conv.MustString(gjson.Get(v.ProductSnap, "ProductPrice"))
|
|
|
|
+ jsonData, mapErr := json.Marshal(kuaiShouProductInfo)
|
|
|
|
+ if mapErr != nil {
|
|
|
|
+ return nil, 0, mapErr
|
|
|
|
+ }
|
|
|
|
+ v.ProductSnap = string(jsonData)
|
|
|
|
+
|
|
if searchValue == "" {
|
|
if searchValue == "" {
|
|
newSelectionInfos = append(newSelectionInfos, v)
|
|
newSelectionInfos = append(newSelectionInfos, v)
|
|
} else if strings.Contains(v.SelectionID, searchValue) {
|
|
} else if strings.Contains(v.SelectionID, searchValue) {
|