|
|
|
@ -17,7 +17,6 @@ import (
|
|
|
|
|
"recook/internal/cache"
|
|
|
|
|
. "recook/internal/dbc"
|
|
|
|
|
"recook/internal/define"
|
|
|
|
|
"recook/internal/model/order"
|
|
|
|
|
"recook/internal/model/user"
|
|
|
|
|
service "recook/internal/service/app"
|
|
|
|
|
"recook/internal/static_path"
|
|
|
|
@ -654,16 +653,16 @@ func login(c *gin.Context, info *user.Information) {
|
|
|
|
|
if realInfo.ID > 0 {
|
|
|
|
|
isVerified = true
|
|
|
|
|
}
|
|
|
|
|
if info.Level == 0 && info.ParentID != 0 {
|
|
|
|
|
var od order.Information
|
|
|
|
|
mysql2.Db.First(&od, "user_id = ? and status =4", info.ID)
|
|
|
|
|
if od.ID > 0 {
|
|
|
|
|
// upgrade 存在已完成的订单
|
|
|
|
|
if err := DB.Table(info.TableName()).Where("id=?", info.ID).Update("level", 1).Error; err != nil {
|
|
|
|
|
back.Fail(c, err.Error())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// if info.Level == 0 && info.ParentID != 0 {
|
|
|
|
|
// var od order.Information
|
|
|
|
|
// mysql2.Db.First(&od, "user_id = ? and status =4", info.ID)
|
|
|
|
|
// if od.ID > 0 {
|
|
|
|
|
// // upgrade 存在已完成的订单
|
|
|
|
|
// if err := DB.Table(info.TableName()).Where("id=?", info.ID).Update("level", 1).Error; err != nil {
|
|
|
|
|
// back.Fail(c, err.Error())
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//追加app登录状态
|
|
|
|
|
if err := DB.Table(info.TableName()).Where("id=?", info.ID).Update("login_app", 1).Error; err != nil {
|
|
|
|
|
back.Fail(c, err.Error())
|
|
|
|
|