fix
This commit is contained in:
parent
f258956df7
commit
1a4131c938
|
@ -42,7 +42,6 @@ func GetOrder(c *gin.Context) {
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
common.Success(c, response)
|
common.Success(c, response)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ func GetInstance() *merchantModel {
|
||||||
func (m *merchantModel) GetById(id int64) (merchant *Merchant, has bool, err error) {
|
func (m *merchantModel) GetById(id int64) (merchant *Merchant, has bool, err error) {
|
||||||
merchant = &Merchant{}
|
merchant = &Merchant{}
|
||||||
has, err = m.GetDb().ID(id).Get(merchant)
|
has, err = m.GetDb().ID(id).Get(merchant)
|
||||||
if err == nil || !has {
|
if err != nil || !has {
|
||||||
merchant = nil
|
merchant = nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -72,7 +72,7 @@ func GetInstance() *ordersModel {
|
||||||
func (m *ordersModel) GetById(id int64) (orders *Orders, has bool, err error) {
|
func (m *ordersModel) GetById(id int64) (orders *Orders, has bool, err error) {
|
||||||
orders = &Orders{}
|
orders = &Orders{}
|
||||||
has, err = m.GetDb().ID(id).Get(orders)
|
has, err = m.GetDb().ID(id).Get(orders)
|
||||||
if err == nil || !has {
|
if err != nil || !has {
|
||||||
orders = nil
|
orders = nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -81,7 +81,7 @@ func (m *ordersModel) GetById(id int64) (orders *Orders, has bool, err error) {
|
||||||
func (m *ordersModel) GetByOutTradeNo(out_trade_no string, merchant_id int64) (orders *Orders, has bool, err error) {
|
func (m *ordersModel) GetByOutTradeNo(out_trade_no string, merchant_id int64) (orders *Orders, has bool, err error) {
|
||||||
orders = &Orders{}
|
orders = &Orders{}
|
||||||
has, err = m.GetDb().Where("out_trade_no = ? and merchant_id = ?", out_trade_no, merchant_id).Get(orders)
|
has, err = m.GetDb().Where("out_trade_no = ? and merchant_id = ?", out_trade_no, merchant_id).Get(orders)
|
||||||
if err == nil || !has {
|
if err != nil || !has {
|
||||||
orders = nil
|
orders = nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -56,7 +56,7 @@ func GetInstance() *productModel {
|
||||||
func (m *productModel) GetById(id int64) (product *Product, has bool, err error) {
|
func (m *productModel) GetById(id int64) (product *Product, has bool, err error) {
|
||||||
product = &Product{}
|
product = &Product{}
|
||||||
has, err = m.GetDb().ID(id).Get(product)
|
has, err = m.GetDb().ID(id).Get(product)
|
||||||
if err == nil || !has {
|
if err != nil || !has {
|
||||||
product = nil
|
product = nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -56,7 +56,7 @@ func GetInstance() *whitelistModel {
|
||||||
func (m *whitelistModel) GetById(id int64) (whitelist *Whitelist, has bool, err error) {
|
func (m *whitelistModel) GetById(id int64) (whitelist *Whitelist, has bool, err error) {
|
||||||
whitelist = &Whitelist{}
|
whitelist = &Whitelist{}
|
||||||
has, err = m.GetDb().ID(id).Get(whitelist)
|
has, err = m.GetDb().ID(id).Get(whitelist)
|
||||||
if err == nil || !has {
|
if err != nil || !has {
|
||||||
whitelist = nil
|
whitelist = nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -65,7 +65,7 @@ func (m *whitelistModel) GetById(id int64) (whitelist *Whitelist, has bool, err
|
||||||
func (m *whitelistModel) GetByIp(ip string) (whitelist *Whitelist, has bool, err error) {
|
func (m *whitelistModel) GetByIp(ip string) (whitelist *Whitelist, has bool, err error) {
|
||||||
whitelist = &Whitelist{}
|
whitelist = &Whitelist{}
|
||||||
has, err = m.GetDb().Where("ip = ?", ip).Get(whitelist)
|
has, err = m.GetDb().Where("ip = ?", ip).Get(whitelist)
|
||||||
if err == nil || !has {
|
if err != nil || !has {
|
||||||
whitelist = nil
|
whitelist = nil
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue