This commit is contained in:
laodaming
2023-07-17 17:08:45 +08:00
parent eedce6c2d7
commit e1bc5fbe51
6 changed files with 276 additions and 1 deletions

View File

@@ -48,6 +48,6 @@ func (o *FsOrderModel) FindOneAndCreateServiceContact(ctx context.Context, userI
// 获取用户最近下单成功的订单
func (o *FsOrderModel) FindLastSuccessOneOrder(ctx context.Context, userId int64, statusGt int64) (order *FsOrder, err error) {
err = o.db.WithContext(ctx).Model(&FsOrder{}).Where("`user_id` = ? and `status` > ?", userId, statusGt).Order("id DESC").Find(&order).Error
err = o.db.WithContext(ctx).Model(&FsOrder{}).Where("`user_id` = ? and `status` > ?", userId, statusGt).Order("id DESC").Take(&order).Error
return order, err
}