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