[update] BpConsumption

This commit is contained in:
Lkeme 2025-09-04 18:02:38 +08:00
parent 374591393e
commit efe31f4c68
3 changed files with 11 additions and 3 deletions

View File

@ -18,6 +18,8 @@
- 更新设备信息
- 更新部分使用文档
- 更新关于B币券的说明
-
### Fixed

View File

@ -77,9 +77,15 @@ class BpConsumption extends BasePlugin
if ($bp_balance != 5) return;
// 消费B币充电
if (getConf('bp_consumption.bp2charge', false, 'bool')) {
// UID为空就切换成自己的
// UID为空就切换成作者的
$up_mid = getConf('bp_consumption.bp2charge_uid', 6580464, 'int');
// 额外判断 现在不能给自己充电
$user = User::parseCookie();
$up_mid = getConf('bp_consumption.bp2charge_uid', intval($user['uid']), 'int');
if ($up_mid == intval($user['uid'])) {
Log::warning("消费B币券: 充电UID不能为自己 {$up_mid},请检查设置项");
return;
}
$this->BP2charge($up_mid, $bp_balance);
return;
}

View File

@ -89,7 +89,7 @@ enable = false
; B币券消费/年度大会员专享/每月默认充值数量5B币/消费方式优先级从上到下
[bp_consumption]
enable = false
# 消费B币充电/充电的目标UID/充值自己的UID
# 消费B币充电/充电的目标UID/不能充值自己的UID
bp2charge = false
bp2charge_uid = 6580464
# 消费B币充值金瓜子/5000金瓜子