1
This commit is contained in:
parent
c76277efd9
commit
bc888c9dc4
@ -2,9 +2,9 @@ package model
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"f5"
|
"f5"
|
||||||
//"errors"
|
"errors"
|
||||||
"main/constant"
|
"main/constant"
|
||||||
//"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InAppOrder struct {
|
type InAppOrder struct {
|
||||||
@ -36,3 +36,13 @@ func (this *InAppOrder) UpdateFields(fields []string) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *InAppOrder) Find(accountId string, orderId string) (error, bool) {
|
||||||
|
if result := f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(this.TableName()).Take(
|
||||||
|
this, "account_id = ? AND order_id = ?", accountId, orderId); result.Error != nil &&
|
||||||
|
!errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||||
|
return result.Error, false
|
||||||
|
} else {
|
||||||
|
return nil, result.RowsAffected > 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user