aa
This commit is contained in:
@@ -191,13 +191,13 @@ func GetManageStatisticsJob(ctx *jxcontext.Context, cityCodes []int, fromTime, t
|
||||
func UnionOrderCallBack(unionOrder *partner.UnionOrderInfo) (err error) {
|
||||
globals.SugarLogger.Debugf("UnionOrderCallBack unionOrder: %v", utils.Format4Output(unionOrder, true))
|
||||
var (
|
||||
jobOrder = &model.JobOrder{}
|
||||
db = dao.GetDB()
|
||||
db = dao.GetDB()
|
||||
)
|
||||
if unionOrder.SID == "" {
|
||||
return err
|
||||
}
|
||||
jobOrder.ID = utils.Str2Int64(unionOrder.SID)
|
||||
userID := unionOrder.SID[:32]
|
||||
jobID := unionOrder.SID[32:]
|
||||
txDB, _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
@@ -205,14 +205,11 @@ func UnionOrderCallBack(unionOrder *partner.UnionOrderInfo) (err error) {
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
if err := dao.GetEntity(db, jobOrder); err != nil {
|
||||
return err
|
||||
}
|
||||
userBill, err := dao.GetUserBill(db, jobOrder.UserID, "")
|
||||
userBill, err := dao.GetUserBill(db, userID, "")
|
||||
if userBill == nil {
|
||||
return fmt.Errorf("未查询到该用户的账单!")
|
||||
}
|
||||
if err = financial.AddIncomeUpdateAccount(txDB, userBill, model.BillTypeUnionShare, int(unionOrder.Profit), jobOrder.JobID); err != nil {
|
||||
if err = financial.AddIncomeUpdateAccount(txDB, userBill, model.BillTypeUnionShare, int(unionOrder.Profit), utils.Str2Int(jobID)); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user