Commit 24ebe81f authored by shajiaiming's avatar shajiaiming

fix

parent 34e8c7c5
......@@ -19,7 +19,6 @@ func AUTH() gin.HandlerFunc {
code = e.INVALID_PARAMS
} else {
_, err := models.CheckToken(token)
fmt.Println(err)
if err != nil {
code = e.ERROR_AUTH_CHECK_TOKEN_FAIL
}
......
......@@ -27,7 +27,7 @@ func (c Currency) TableName() string {
func GetCurrencies() ([]*Currency, error) {
var currencies []*Currency
err := db.Debug().Select("id, pj_name").Find(&currencies).Error
err := db.Select("id, pj_name").Find(&currencies).Error
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
......
......@@ -50,7 +50,7 @@ func ExistPlatformChainById(id int) (bool, error) {
func GetPlatformChainTotal(maps interface{}) (int, error) {
var count int
if err := db.Debug().Model(&PlatformChain{}).Where(maps).Count(&count).Error; err != nil {
if err := db.Model(&PlatformChain{}).Where(maps).Count(&count).Error; err != nil {
return 0, err
}
......
......@@ -13,7 +13,7 @@ type SupportedCurrency struct {
CurrencyId int `json:"currency_id"` //法币ID
Sort int `json:"sort"` //排序
CurrencyInfo *Currency `gorm:"foreignkey:CurrencyId"`
Currency *Currency `json:"Currency"`
}
func (c SupportedCurrency) TableName() string {
......@@ -61,7 +61,7 @@ func GetSupportedCurrencyTotal(maps interface{}) (int, error) {
func GetSupportedCurrencies(pageNum, pageSize int, maps interface{}) ([]*SupportedCurrency, error) {
var currencies []*SupportedCurrency
err := db.Preload("CurrencyInfo").Where(maps).Offset(pageNum).Limit(pageSize).Find(&currencies).Error
err := db.Preload("Currency").Where(maps).Offset(pageNum).Limit(pageSize).Find(&currencies).Error
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
......
......@@ -68,7 +68,6 @@ func (w *Wallet) Edit() error {
}
func (w *Wallet) ExistById() (bool, error) {
fmt.Println(w.Id)
return models.ExistWalletById(w.Id)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment