|
|
@@ -2498,7 +2498,6 @@ class StoreOrder extends BaseModel
|
|
|
if (isset($order['combination_id']) && $order['combination_id']) return true;
|
|
|
if (isset($order['seckill_id']) && $order['seckill_id']) return true;
|
|
|
if (isset($order['bargain_id']) && $order['bargain_id']) return true;
|
|
|
- @file_put_contents('order.txt', '【8.1】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$userInfo = User::getUserInfo($order['uid']);
|
|
|
$spread = User::getUserInfo($userInfo['spread_uid']);
|
|
|
// if (StoreOrder::where('uid', $order['uid'])->where('paid', 1)->where('refund_status', 0)->where('is_del', 0)->where('is_system_del', 0)
|
|
|
@@ -2529,10 +2528,8 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.2】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$res = true;
|
|
|
$suit_recommend = sys_config('suit_recommend', 0, true);
|
|
|
- @file_put_contents('order.txt', '【8.3】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
if ($spread) {
|
|
|
//推荐奖
|
|
|
$brokeragePrice = bcmul($suit_recommend, $suit - $suit_exit, 2);
|
|
|
@@ -2544,7 +2541,6 @@ class StoreOrder extends BaseModel
|
|
|
$spread['brokerage_price'] = bcadd($spread['brokerage_price'], $brokeragePrice, 2);
|
|
|
}
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.4】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$send = 0;
|
|
|
$send_normal = 0;
|
|
|
$layer = 1;
|
|
|
@@ -2555,12 +2551,10 @@ class StoreOrder extends BaseModel
|
|
|
foreach ($layer_award as $v) {
|
|
|
$layer_award_real[$v['layer']] = $v;
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.5】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
while ($spread) {
|
|
|
$group_level = SystemGroupLevel::get($spread['group_level']);
|
|
|
$award_level = SystemGroupLevel::get($spread['award_level']);
|
|
|
$balance = $spread['brokerage_price'];
|
|
|
- @file_put_contents('order.txt', '【8.6】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
if ($suit) {
|
|
|
$award_group = $group_level['suit_award'] ?? 0;
|
|
|
$award_award = $award_level['suit_award'] ?? 0;
|
|
|
@@ -2581,21 +2575,20 @@ class StoreOrder extends BaseModel
|
|
|
$send = $brokeragePrice;
|
|
|
}
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.7】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
if ($group_level['company_award'] > 0 || $award_level['company_award'] > 0 && !$company_award) {
|
|
|
$ratio = ($group_level['company_award'] > $award_level['company_award'] ? $group_level['company_award'] : $award_level['company_award']);
|
|
|
$spread_up = User::where('uid', $spread['spread_uid'])->find();
|
|
|
$group_levels = SystemGroupLevel::where('company_award', '>', 0)->column('id');
|
|
|
$award_levels = SystemAwardLevel::where('company_award', '>', 0)->column('id');
|
|
|
- @file_put_contents('order.txt', '【8.8】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
+// @file_put_contents('order.txt', '【8.8】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
while ($spread_up) {
|
|
|
if (in_array($spread_up['group_level'], $group_levels) || in_array($spread_up['award_level'], $award_levels)) {
|
|
|
$ratio -= 1;
|
|
|
break;
|
|
|
}
|
|
|
- $spread_up = User::where('uid', $spread_up['uid'])->find();
|
|
|
+ $spread_up = User::where('uid', $spread_up['spread_uid'])->find();
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.9】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
+// @file_put_contents('order.txt', '【8.9】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$c = [];
|
|
|
$p = [$spread['uid']];
|
|
|
while ($p) {
|
|
|
@@ -2616,7 +2609,6 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
|
$p = User::where('spread_uid', 'in', $p)->where('uid', 'not in', $child)->column('uid');
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.10】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$ratio += count(array_unique($c));
|
|
|
if ($ratio > 0) {
|
|
|
$op_award = bcmul($suit_price, bcdiv($ratio, 100, 4), 2);
|
|
|
@@ -2627,10 +2619,8 @@ class StoreOrder extends BaseModel
|
|
|
$balance = bcadd($balance, $op_award, 2);
|
|
|
}
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.11】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$company_award = true;
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.12】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
if ($group_level['operate_award'] > 0 || $award_level['operate_award'] > 0 && !$operate_award) {
|
|
|
$ratio = ($group_level['operate_award'] > $award_level['operate_award'] ? $group_level['operate_award'] : $award_level['operate_award']);
|
|
|
if ($ratio > 0) {
|
|
|
@@ -2644,7 +2634,6 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
|
$operate_award = true;
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.13】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
}
|
|
|
$lay_award = $layer_award_real[$layer] ?? null;
|
|
|
if ($lay_award) {
|
|
|
@@ -2707,7 +2696,6 @@ class StoreOrder extends BaseModel
|
|
|
// }
|
|
|
$spread = User::getUserInfo($spread['spread_uid']);
|
|
|
}
|
|
|
- @file_put_contents('order.txt', '【8.14】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
return $res;
|
|
|
}
|
|
|
|