|
|
@@ -175,16 +175,6 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str |
|
|
|
return errors.New("非运行时间") |
|
|
|
} |
|
|
|
|
|
|
|
if isTask { |
|
|
|
//TODO::增加“悲观锁”防止串行 |
|
|
|
getString, _ := cache.GetString(PessimismLockKeyForIntegralReleaseForInterposition) |
|
|
|
if getString == PessimismLockValueForIntegralRelease { |
|
|
|
fmt.Println("-----------------", "上一次结算未执行完") |
|
|
|
return errors.New("上一次结算未执行完") |
|
|
|
} |
|
|
|
cache.SetEx(PessimismLockKeyForIntegralReleaseForInterposition, PessimismLockValueForIntegralRelease, 3600*10) //10小时 |
|
|
|
} |
|
|
|
|
|
|
|
//1、查找 `integral_release` 基础设置 |
|
|
|
integralRelease, err := db.IntegralReleaseGetOneByParams(session, map[string]interface{}{ |
|
|
|
"key": "is_use", |
|
|
@@ -199,6 +189,16 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str |
|
|
|
return errors.New("今日“积分释放”未结算") |
|
|
|
} |
|
|
|
|
|
|
|
if isTask { |
|
|
|
//TODO::增加“悲观锁”防止串行 |
|
|
|
getString, _ := cache.GetString(PessimismLockKeyForIntegralReleaseForInterposition) |
|
|
|
if getString == PessimismLockValueForIntegralRelease { |
|
|
|
fmt.Println("-----------------", "上一次结算未执行完") |
|
|
|
return errors.New("上一次结算未执行完") |
|
|
|
} |
|
|
|
cache.SetEx(PessimismLockKeyForIntegralReleaseForInterposition, PessimismLockValueForIntegralRelease, 3600*10) //10小时 |
|
|
|
} |
|
|
|
|
|
|
|
//2、查询所有 `integral_release_interposition_user_amount` 记录 |
|
|
|
var users []model.IntegralReleaseInterpositionUserAmount |
|
|
|
err = session.Where("waite_amount > 0").Find(&users) |
|
|
|