各位大佬,我看到多商户这个写入佣金最终是执行这个函数,但是我没有看到操作佣金的地方呢,如果我想修改佣金写入的逻辑,应该去哪个文件里找呢?
/**
* 更新用户佣金排名
*
* 本函数用于根据用户ID($uid)增加或减少用户的佣金,并更新其在周榜和月榜上的排名。
* $inc参数指定佣金的变化量,$type参数指定操作类型,默认为'+', 表示增加佣金。
*
* @param int $uid 用户ID
* @param float $inc 佣金变化量
* @param string $type 操作类型,默认为'+', 表示增加佣金;'-'表示减少佣金。
*/
public function incBrokerage($uid, $inc, $type = '+')
{
// 构造月度佣金排行榜的键名
$moneyKey = 'b_top_' . date('Y-m');
// 构造周度佣金排行榜的键名
$weekKey = 'b_top_' . monday();
// 从周度佣金排行榜中获取用户当前佣金,准备进行更新
//TODO 佣金周榜
$brokerage = Cache::zscore($weekKey, $uid);
// 根据$type的值决定是增加还是减少佣金,并保留两位小数
$brokerage = $type == '+' ? bcadd($brokerage, $inc, 2) : bcsub($brokerage, $inc, 2);
// 更新用户在周度佣金排行榜上的佣金及排名
Cache::zadd($weekKey, $brokerage, $uid);
// 从月度佣金排行榜中获取用户当前佣金,准备进行更新
//TODO 佣金月榜
$brokerage = Cache::zscore($moneyKey, $uid);
// 根据$type的值决定是增加还是减少佣金,并保留两位小数
$brokerage = $type == '+' ? bcadd($brokerage, $inc, 2) : bcsub($brokerage, $inc, 2);
// 更新用户在月度佣金排行榜上的佣金及排名
Cache::zadd($moneyKey, $brokerage, $uid);
}

