|
|
@@ -240,7 +240,8 @@ class Balance {
|
|
|
* @throws Exception
|
|
|
* @throws \yii\db\Exception
|
|
|
*/
|
|
|
- public static function changeUserBonus($userId, $type, $amount, $params = [], $allowMinus = false) {
|
|
|
+ public static function changeUserBonus($userId, $type, $amount, $params = [], $allowMinus = false): bool
|
|
|
+ {
|
|
|
if (array_key_exists($type, UserBonus::TYPE)) {
|
|
|
$type = strtoupper($type);
|
|
|
}
|
|
|
@@ -265,6 +266,7 @@ class Balance {
|
|
|
default:
|
|
|
throw new Exception('流水类型错误');
|
|
|
}
|
|
|
+
|
|
|
if (RedisLock::instance()->lock($lockKey)) {
|
|
|
// 改变发奖
|
|
|
$paramData = [];
|