You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
743 B

4 years ago
package public
import (
"git.oa00.com/go/mysql"
4 years ago
"recook/internal/dbc"
"recook/internal/model/order"
4 years ago
"strconv"
)
func Judge(orderID uint) bool {
var od order.Information
mysql.Db.First(&od, "id = ?", orderID)
if od.ID != 0 {
return true
} else {
4 years ago
return false
}
}
func JudgeString(orderID string) bool {
id, _ := strconv.Atoi(orderID)
return Judge(uint(id))
4 years ago
}
func UpdateVirtualPay(id uint) error {
if err := dbc.DB.Table("recook_order_info").
Where("virtual_id = ?", id).Update("pay_type", 1).Error; err != nil {
return err
}
return nil
}
func UpdateNormalPay(id uint) error {
if err := dbc.DB.Table("recook_order_info").
Where("id = ?", id).Update("pay_type", 0).Error; err != nil {
return err
}
return nil
}