This commit is contained in:
chenbo 2024-02-04 09:55:09 +08:00
parent a05d04b389
commit 6e8a9f3f94
1 changed files with 12 additions and 7 deletions

View File

@ -51,13 +51,7 @@ class ShopCallController extends BaseApiController
if ($userSelf->isEmpty()) { if ($userSelf->isEmpty()) {
return $this->fail('推广人不存在'); return $this->fail('推广人不存在');
} }
$proportion = 0.03; $type = 0;
// 计算分润
UserLogic::userProfit($userSelf, $orderMoney, $proportion, $orderNo);
// 首单金额记录
UserLogic::firstOrderLog($userSelf['id'], $orderMoney, $orderNo);
if (in_array($userSelf['group_id'] , [2, 18])) { if (in_array($userSelf['group_id'] , [2, 18])) {
$type = 1; $type = 1;
} }
@ -67,6 +61,17 @@ class ShopCallController extends BaseApiController
if ($userSelf['group_id'] == 15) { if ($userSelf['group_id'] == 15) {
$type = 3; $type = 3;
} }
if($type === 0) {
return $this->fail('推广人不属于分佣角色');
}
$proportion = 0.03;
// 计算分润
UserLogic::userProfit($userSelf, $orderMoney, $proportion, $orderNo);
// 首单金额记录
UserLogic::firstOrderLog($userSelf['id'], $orderMoney, $orderNo);
// 通知商城 // 通知商城
$request['user'] = [ $request['user'] = [
['type' => $type, 'account' => $userSelf['account'], 'user_profit' => bcmul($orderMoney, 0.03)] ['type' => $type, 'account' => $userSelf['account'], 'user_profit' => bcmul($orderMoney, 0.03)]