|
@@ -713,7 +713,7 @@ class StoreOrder extends BaseModel
|
|
|
|
|
|
|
|
$res1 = false !== User::bcDec($uid, 'now_money', $orderInfo['pay_price'], 'uid');
|
|
$res1 = false !== User::bcDec($uid, 'now_money', $orderInfo['pay_price'], 'uid');
|
|
|
$res2 = UserBill::expend('购买商品', $uid, 'now_money', 'pay_product', $orderInfo['pay_price'], $orderInfo['id'], $userInfo['now_money'], '余额支付' . floatval($orderInfo['pay_price']) . '元购买商品');
|
|
$res2 = UserBill::expend('购买商品', $uid, 'now_money', 'pay_product', $orderInfo['pay_price'], $orderInfo['id'], $userInfo['now_money'], '余额支付' . floatval($orderInfo['pay_price']) . '元购买商品');
|
|
|
- @file_put_contents('order.txt', '【4】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
|
|
|
|
+// @file_put_contents('order.txt', '【4】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$res3 = self::paySuccess($order_id, 'yue', $formId);//余额支付成功
|
|
$res3 = self::paySuccess($order_id, 'yue', $formId);//余额支付成功
|
|
|
try {
|
|
try {
|
|
|
PaymentRepositories::yuePayProduct($userInfo, $orderInfo);
|
|
PaymentRepositories::yuePayProduct($userInfo, $orderInfo);
|
|
@@ -855,9 +855,9 @@ class StoreOrder extends BaseModel
|
|
|
$res2 = true;
|
|
$res2 = true;
|
|
|
$user = User::where('uid', $order['uid'])->find();
|
|
$user = User::where('uid', $order['uid'])->find();
|
|
|
if (($order['suit'] > 0 || $order['is_bind'] > 0) && !$user['lock_spread'] && $user['spread_uid']) User::where('uid', $order['uid'])->update(['lock_spread' => 1]);
|
|
if (($order['suit'] > 0 || $order['is_bind'] > 0) && !$user['lock_spread'] && $user['spread_uid']) User::where('uid', $order['uid'])->update(['lock_spread' => 1]);
|
|
|
- @file_put_contents('order.txt', '【6】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
|
|
|
|
+// @file_put_contents('order.txt', '【6】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$res2 = $res2 && self::addSuit($order);
|
|
$res2 = $res2 && self::addSuit($order);
|
|
|
- @file_put_contents('order.txt', '【7】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
|
|
|
|
+// @file_put_contents('order.txt', '【7】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$res2 = $res2 && StoreOrder::sendSuit($order);
|
|
$res2 = $res2 && StoreOrder::sendSuit($order);
|
|
|
@file_put_contents('order.txt', '【8】' . time() . PHP_EOL, FILE_APPEND);
|
|
@file_put_contents('order.txt', '【8】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$res2 = $res2 && StoreOrder::sendGroupAward($order);
|
|
$res2 = $res2 && StoreOrder::sendGroupAward($order);
|
|
@@ -2498,7 +2498,7 @@ class StoreOrder extends BaseModel
|
|
|
if (isset($order['combination_id']) && $order['combination_id']) return true;
|
|
if (isset($order['combination_id']) && $order['combination_id']) return true;
|
|
|
if (isset($order['seckill_id']) && $order['seckill_id']) return true;
|
|
if (isset($order['seckill_id']) && $order['seckill_id']) return true;
|
|
|
if (isset($order['bargain_id']) && $order['bargain_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']);
|
|
$userInfo = User::getUserInfo($order['uid']);
|
|
|
$spread = User::getUserInfo($userInfo['spread_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)
|
|
// if (StoreOrder::where('uid', $order['uid'])->where('paid', 1)->where('refund_status', 0)->where('is_del', 0)->where('is_system_del', 0)
|
|
@@ -2529,8 +2529,10 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.2】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$res = true;
|
|
$res = true;
|
|
|
$suit_recommend = sys_config('suit_recommend', 0, true);
|
|
$suit_recommend = sys_config('suit_recommend', 0, true);
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.3】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
if ($spread) {
|
|
if ($spread) {
|
|
|
//推荐奖
|
|
//推荐奖
|
|
|
$brokeragePrice = bcmul($suit_recommend, $suit - $suit_exit, 2);
|
|
$brokeragePrice = bcmul($suit_recommend, $suit - $suit_exit, 2);
|
|
@@ -2542,7 +2544,7 @@ class StoreOrder extends BaseModel
|
|
|
$spread['brokerage_price'] = bcadd($spread['brokerage_price'], $brokeragePrice, 2);
|
|
$spread['brokerage_price'] = bcadd($spread['brokerage_price'], $brokeragePrice, 2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.4】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$send = 0;
|
|
$send = 0;
|
|
|
$send_normal = 0;
|
|
$send_normal = 0;
|
|
|
$layer = 1;
|
|
$layer = 1;
|
|
@@ -2553,10 +2555,12 @@ class StoreOrder extends BaseModel
|
|
|
foreach ($layer_award as $v) {
|
|
foreach ($layer_award as $v) {
|
|
|
$layer_award_real[$v['layer']] = $v;
|
|
$layer_award_real[$v['layer']] = $v;
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.5】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
while ($spread) {
|
|
while ($spread) {
|
|
|
$group_level = SystemGroupLevel::get($spread['group_level']);
|
|
$group_level = SystemGroupLevel::get($spread['group_level']);
|
|
|
$award_level = SystemGroupLevel::get($spread['award_level']);
|
|
$award_level = SystemGroupLevel::get($spread['award_level']);
|
|
|
$balance = $spread['brokerage_price'];
|
|
$balance = $spread['brokerage_price'];
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.6】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
if ($suit) {
|
|
if ($suit) {
|
|
|
$award_group = $group_level['suit_award'] ?? 0;
|
|
$award_group = $group_level['suit_award'] ?? 0;
|
|
|
$award_award = $award_level['suit_award'] ?? 0;
|
|
$award_award = $award_level['suit_award'] ?? 0;
|
|
@@ -2577,11 +2581,13 @@ class StoreOrder extends BaseModel
|
|
|
$send = $brokeragePrice;
|
|
$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) {
|
|
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']);
|
|
$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();
|
|
$spread_up = User::where('uid', $spread['spread_uid'])->find();
|
|
|
$group_levels = SystemGroupLevel::where('company_award', '>', 0)->column('id');
|
|
$group_levels = SystemGroupLevel::where('company_award', '>', 0)->column('id');
|
|
|
$award_levels = SystemAwardLevel::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);
|
|
|
while ($spread_up) {
|
|
while ($spread_up) {
|
|
|
if (in_array($spread_up['group_level'], $group_levels) || in_array($spread_up['award_level'], $award_levels)) {
|
|
if (in_array($spread_up['group_level'], $group_levels) || in_array($spread_up['award_level'], $award_levels)) {
|
|
|
$ratio -= 1;
|
|
$ratio -= 1;
|
|
@@ -2589,6 +2595,7 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
}
|
|
|
$spread_up = User::where('uid', $spread_up['uid'])->find();
|
|
$spread_up = User::where('uid', $spread_up['uid'])->find();
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.9】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$c = [];
|
|
$c = [];
|
|
|
$p = [$spread['uid']];
|
|
$p = [$spread['uid']];
|
|
|
while ($p) {
|
|
while ($p) {
|
|
@@ -2609,6 +2616,7 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
}
|
|
|
$p = User::where('spread_uid', 'in', $p)->where('uid', 'not in', $child)->column('uid');
|
|
$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));
|
|
$ratio += count(array_unique($c));
|
|
|
if ($ratio > 0) {
|
|
if ($ratio > 0) {
|
|
|
$op_award = bcmul($suit_price, bcdiv($ratio, 100, 4), 2);
|
|
$op_award = bcmul($suit_price, bcdiv($ratio, 100, 4), 2);
|
|
@@ -2619,8 +2627,10 @@ class StoreOrder extends BaseModel
|
|
|
$balance = bcadd($balance, $op_award, 2);
|
|
$balance = bcadd($balance, $op_award, 2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.11】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
$company_award = true;
|
|
$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) {
|
|
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']);
|
|
$ratio = ($group_level['operate_award'] > $award_level['operate_award'] ? $group_level['operate_award'] : $award_level['operate_award']);
|
|
|
if ($ratio > 0) {
|
|
if ($ratio > 0) {
|
|
@@ -2634,6 +2644,7 @@ class StoreOrder extends BaseModel
|
|
|
}
|
|
}
|
|
|
$operate_award = true;
|
|
$operate_award = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.13】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
}
|
|
}
|
|
|
$lay_award = $layer_award_real[$layer] ?? null;
|
|
$lay_award = $layer_award_real[$layer] ?? null;
|
|
|
if ($lay_award) {
|
|
if ($lay_award) {
|
|
@@ -2696,6 +2707,7 @@ class StoreOrder extends BaseModel
|
|
|
// }
|
|
// }
|
|
|
$spread = User::getUserInfo($spread['spread_uid']);
|
|
$spread = User::getUserInfo($spread['spread_uid']);
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('order.txt', '【8.14】' . time() . PHP_EOL, FILE_APPEND);
|
|
|
return $res;
|
|
return $res;
|
|
|
}
|
|
}
|
|
|
|
|
|