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.
|
|
|
package public
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.oa00.com/go/mysql"
|
|
|
|
"recook/internal/dbc"
|
|
|
|
"recook/internal/model/order"
|
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Judge(orderID uint) bool {
|
|
|
|
var od order.Information
|
|
|
|
mysql.Db.First(&od, "id = ?", orderID)
|
|
|
|
if od.ID != 0 {
|
|
|
|
return true
|
|
|
|
} else {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func JudgeString(orderID string) bool {
|
|
|
|
id, _ := strconv.Atoi(orderID)
|
|
|
|
return Judge(uint(id))
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|