|
|
@@ -986,6 +986,8 @@ class StoreOrder extends BaseModel
|
|
|
// }
|
|
|
$spread_uid = User::where('uid', $order['uid'])->value('spread_uid');
|
|
|
if ($spread_uid == $uid) { //如果订单用户上级uid和传参的uid相同说明是第一层
|
|
|
+ @file_put_contents('quanju.txt', "-如果订单用户上级uid和传参的uid相同说明是第一层\r\n", 8);
|
|
|
+
|
|
|
$shopping_cart = $order['cart_id'];
|
|
|
// 先不考虑什么商品返现比例了
|
|
|
foreach ($shopping_cart as $cart) {
|
|
|
@@ -1019,10 +1021,13 @@ class StoreOrder extends BaseModel
|
|
|
@file_put_contents('quanju.txt', json_encode($level_info) . "-等级信息\r\n", 8);
|
|
|
|
|
|
if ($parentLevel > $level_info['grade']) { //如果上上级等级小于上级,就直接跳过
|
|
|
+ @file_put_contents('quanju.txt', "-如果上上级等级小于上级,就直接跳过\r\n", 8);
|
|
|
+
|
|
|
if ($user['spread_uid'] > 0) {
|
|
|
self::processRebate($order, $user['spread_uid'], $parentLevel, $parentBrokerage);
|
|
|
}
|
|
|
} elseif ($parentLevel == $level_info['grade']) { //如果上上级等级等于上级,就获取上级佣金的10%
|
|
|
+ @file_put_contents('quanju.txt', "-如果上上级等级等于上级,就获取上级佣金的10%\r\n", 8);
|
|
|
|
|
|
$userPeerLevel = sys_config('user_peer_level', 10);
|
|
|
if ($userPeerLevel > 0) {
|
|
|
@@ -1030,6 +1035,8 @@ class StoreOrder extends BaseModel
|
|
|
$brokerage = bcmul($parentBrokerage, $userPeerLevel, 2);
|
|
|
}
|
|
|
} elseif ($parentLevel < $parentLevel['grade']) { //如果上上级等级大于上级,就获取自己等级返利的佣金
|
|
|
+ @file_put_contents('quanju.txt', "-如果上上级等级大于上级,就获取自己等级返利的佣金\r\n", 8);
|
|
|
+
|
|
|
// StoreProductLevel::where('product_id',$)
|
|
|
$shopping_cart = $order['cart_id'];
|
|
|
// 先不考虑什么商品返现比例了
|
|
|
@@ -1038,7 +1045,7 @@ class StoreOrder extends BaseModel
|
|
|
$product_radio = 0;
|
|
|
$product_info = StoreCart::where('id', $cart)->find()->toArray();
|
|
|
|
|
|
- $product = StoreProductLevel::where('id', $product_info['product_id'])->where('level_id', $user['level'])->where('type', 1)->find(); //商品返现比例
|
|
|
+ $product = StoreProductLevel::where('product_id', $product_info['product_id'])->where('level_id', $user['level'])->where('type', 1)->find(); //商品返现比例
|
|
|
if (!empty($product)) {
|
|
|
$product = $product->toArray();
|
|
|
$product_radio = $product['rebate_ratio'];
|