|
@@ -3,20 +3,20 @@ package service
|
|
|
import (
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
- "github.com/gin-gonic/gin"
|
|
|
- "go.uber.org/zap"
|
|
|
- "gorm.io/gorm"
|
|
|
"log"
|
|
|
"sfbase/global"
|
|
|
"sfbase/utils"
|
|
|
"sfis/db"
|
|
|
"sfis/lock"
|
|
|
"sfis/model"
|
|
|
+ utils2 "sfis/utils"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"sync"
|
|
|
- utils2 "sfis/utils"
|
|
|
|
|
|
+ "github.com/gin-gonic/gin"
|
|
|
+ "go.uber.org/zap"
|
|
|
+ "gorm.io/gorm"
|
|
|
)
|
|
|
|
|
|
func CreateUserProduct(appId string, productArr []map[string]interface{}) (status int, haveProductId string, errArr []error) {
|
|
@@ -67,7 +67,7 @@ func CreateUserProduct(appId string, productArr []map[string]interface{}) (statu
|
|
|
}
|
|
|
|
|
|
func UserProductList(appId string, c *gin.Context) (results []map[string]interface{}, err error) {
|
|
|
- err = db.GetSFISDB().Table("user_product").Select("user_product.app_id, user_product.product_id,user_product.create_at,user_product.start_at,user_product.end_at,user_product.left_num,user_product.cost_model,user_product.interface_status,user_product.call_times_limit_day,user_product.data_num_limit_one_times,product.name").Joins("left join product on product.id = user_product.product_id").Where("app_id = ? ", appId).Scan(&results).Error
|
|
|
+ err = db.GetSFISDB().Table("user_product").Select("user_product.app_id,user_product.discount,user_product.product_id,user_product.create_at,user_product.start_at,user_product.end_at,user_product.left_num,user_product.cost_model,user_product.interface_status,user_product.call_times_limit_day,user_product.data_num_limit_one_times,product.name").Joins("left join product on product.id = user_product.product_id").Where("app_id = ? ", appId).Scan(&results).Error
|
|
|
if err != nil {
|
|
|
log.Printf("appID:[%s] find into user_product error:[%v]", appId, err)
|
|
|
}
|