|
@@ -9,7 +9,6 @@ import ( |
|
|
"applet/app/comm/utils/logx" |
|
|
"applet/app/comm/utils/logx" |
|
|
"applet/app/store/md" |
|
|
"applet/app/store/md" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/pay" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/pay" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/implement" |
|
|
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
"fmt" |
|
|
"fmt" |
|
@@ -54,19 +53,19 @@ func CommMoneyCallback(c *gin.Context, oid string) error { |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
data.State = 1 |
|
|
data.State = 1 |
|
|
_, err := svc.MasterDb(c).Where("oid=?", data.Oid).Update(&data) |
|
|
|
|
|
|
|
|
_, err := sess.Where("oid=?", data.Oid).Update(&data) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
sess.Rollback() |
|
|
sess.Rollback() |
|
|
return e.NewErr(400, "修改失败") |
|
|
return e.NewErr(400, "修改失败") |
|
|
} |
|
|
} |
|
|
amountDb := implement.NewCampTaskStoreUserAmountDb(svc.MasterDb(c)) |
|
|
|
|
|
amountData, _ := amountDb.GetCampTaskAmountByStoreId(utils.IntToStr(data.StoreId)) |
|
|
|
|
|
if amountData == nil { |
|
|
|
|
|
amountData = &models.CampTaskStoreUserAmount{ |
|
|
|
|
|
|
|
|
var amountData models.CampTaskStoreUserAmount |
|
|
|
|
|
sess.Where("store_id=?", data.StoreId).Get(&amountData) |
|
|
|
|
|
if amountData.Id == 0 { |
|
|
|
|
|
amountData = models.CampTaskStoreUserAmount{ |
|
|
StoreId: data.StoreId, |
|
|
StoreId: data.StoreId, |
|
|
Amount: "0", |
|
|
Amount: "0", |
|
|
} |
|
|
} |
|
|
_, err := sess.Insert(amountData) |
|
|
|
|
|
|
|
|
_, err := sess.Insert(&amountData) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
sess.Rollback() |
|
|
sess.Rollback() |
|
|
return err |
|
|
return err |
|
@@ -82,12 +81,12 @@ func CommMoneyCallback(c *gin.Context, oid string) error { |
|
|
Title: "预存款充值", |
|
|
Title: "预存款充值", |
|
|
OrdType: "buy", |
|
|
OrdType: "buy", |
|
|
} |
|
|
} |
|
|
_, err = svc.MasterDb(c).InsertOne(&flow) |
|
|
|
|
|
|
|
|
_, err = sess.Insert(&flow) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
sess.Rollback() |
|
|
sess.Rollback() |
|
|
return e.NewErr(400, "修改失败") |
|
|
return e.NewErr(400, "修改失败") |
|
|
} |
|
|
} |
|
|
_, err = svc.MasterDb(c).Where("id=?", amountData.Id).Update(amountData) |
|
|
|
|
|
|
|
|
_, err = svc.MasterDb(c).Where("id=?", amountData.Id).Update(&amountData) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
sess.Rollback() |
|
|
sess.Rollback() |
|
|
return e.NewErr(400, "修改失败") |
|
|
return e.NewErr(400, "修改失败") |
|
|