处理推广佣金发放的错误

This commit is contained in:
luofei 2024-03-09 11:12:03 +08:00
parent 48ae67064f
commit 6679124abf
2 changed files with 5 additions and 4 deletions

View File

@ -802,15 +802,16 @@ class StoreOrderRepository extends BaseRepository
if (!empty($promoterCommission)) {
$userBillRepository->incBill($promoterCommission['user_id'], 'brokerage', 'order_one', [
'link_id' => $order['order_id'],
'status' => 0,
'status' => 1,
'title' => '获得推广佣金',
'number' => $promoterCommission['number'],
'mark' => $order->merchant['mer_name'] . '成功销售' . floatval($order['pay_price']) . '元,奖励推广佣金' . floatval($promoterCommission['number']),
'balance' => 0
]);
$balance = bcadd($user->now_money, $promoterCommission['number'], 2);
$user->save(['now_money' => $balance]);
$promoter = User::where('uid', $promoterCommission['user_id'])->find();
$balance = bcadd($promoter->now_money, $promoterCommission['number'], 2);
$promoter->save(['now_money' => $balance]);
}
}

View File

@ -1690,7 +1690,7 @@ class Auth extends BaseController
return app('json')->fail('验证码不正确');
}
$auth = Cache::get('u_try' . $data['auth_token']);
// $auth && Cache::delete('u_try' . $data['auth_token']);
$auth && Cache::delete('u_try' . $data['auth_token']);
if (empty($auth)) {
return app('json')->fail('授权已过期,请重新登录');
}