hrjy 2 년 전
부모
커밋
42b3d85dad
2개의 변경된 파일12개의 추가작업 그리고 7개의 파일을 삭제
  1. 11 6
      app/api/controller/user/UserController.php
  2. 1 1
      app/models/store/StoreOrder.php

+ 11 - 6
app/api/controller/user/UserController.php

@@ -640,7 +640,7 @@ class UserController
         $partner = sys_config('partner')/100;//合伙人比列
         $partner = sys_config('partner')/100;//合伙人比列
         $shareholder = sys_config('shareholder')/100;//股东比列
         $shareholder = sys_config('shareholder')/100;//股东比列
         $director = sys_config('director')/100;//董事比列
         $director = sys_config('director')/100;//董事比列
-        $user = User::where('level', '>=', 2)->select()->toArray();
+        $user = User::where('level', '>=', 1)->select()->toArray();
 
 
 
 
         $partnerMoney = 0;
         $partnerMoney = 0;
@@ -659,19 +659,24 @@ class UserController
         if (!empty($user)) {
         if (!empty($user)) {
             foreach ($user as $vo) {
             foreach ($user as $vo) {
                 $jl = 0;
                 $jl = 0;
+                $str = '';
                 if ($vo['level'] == 1) {
                 if ($vo['level'] == 1) {
-                    //合伙人
+                    //会员
+                    $str = '会员分红';
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $sp_jl = $partnerMoney * $vo['stock_right'];// 合伙人上级奖励
                     $sp_jl = $partnerMoney * $vo['stock_right'];// 合伙人上级奖励
                 } elseif ($vo['level'] == 2) {
                 } elseif ($vo['level'] == 2) {
-                    //股东
+                    //合伙人
+                    $str = '合伙人分红';
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                 } elseif ($vo['level'] == 3) {
                 } elseif ($vo['level'] == 3) {
                     //股东
                     //股东
+                    $str = '股东分红';
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $jl += $shareholderMoney;// 股东加权奖励
                     $jl += $shareholderMoney;// 股东加权奖励
                 } elseif ($vo['level'] == 4) {
                 } elseif ($vo['level'] == 4) {
-                    //股东
+                    //董事
+                    $str = '董事分红';
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $jl += $partnerMoney * $vo['stock_right'];// 合伙人加权奖励
                     $jl += $shareholderMoney;// 股东加权奖励
                     $jl += $shareholderMoney;// 股东加权奖励
                     $jl += $directorMoney;// 董事加权奖励
                     $jl += $directorMoney;// 董事加权奖励
@@ -696,7 +701,7 @@ class UserController
                         }
                         }
                     }
                     }
                     $model->saveAll($award);
                     $model->saveAll($award);
-                    UserBill::income('佣金', $vo['uid'], 'now_money', 'brokerage', $bdjl, '', $vo['brokerage_price'] + $bdjl, '加权佣金奖励');
+                    UserBill::income('佣金', $vo['uid'], 'now_money', 'brokerage', $bdjl, '', $vo['brokerage_price'] + $bdjl, $str);
                     User::where('uid', $vo['uid'])->inc('brokerage_price', $bdjl)->update();
                     User::where('uid', $vo['uid'])->inc('brokerage_price', $bdjl)->update();
 
 
                     if ($vo['level'] == 1){
                     if ($vo['level'] == 1){
@@ -724,7 +729,7 @@ class UserController
                                         }
                                         }
                                     }
                                     }
                                     $model->saveAll($award);
                                     $model->saveAll($award);
-                                    UserBill::income('佣金', $spread['uid'], 'now_money', 'brokerage', $bdjl, '', $spread['brokerage_price']+$bdjl, '领导奖励');
+                                    UserBill::income('佣金', $spread['uid'], 'now_money', 'brokerage', $bdjl, '', $spread['brokerage_price']+$bdjl, '分享会员分红');
                                     User::where('uid', $spread['uid'])->inc('brokerage_price', $bdjl)->update();
                                     User::where('uid', $spread['uid'])->inc('brokerage_price', $bdjl)->update();
                                 }
                                 }
                             }
                             }

+ 1 - 1
app/models/store/StoreOrder.php

@@ -824,7 +824,7 @@ class StoreOrder extends BaseModel
                     UserBill::income('佣金', $spread['uid'], 'now_money', 'brokerage', $bdjl, '', $spread['brokerage_price']+$bdjl, '分享佣金奖励');
                     UserBill::income('佣金', $spread['uid'], 'now_money', 'brokerage', $bdjl, '', $spread['brokerage_price']+$bdjl, '分享佣金奖励');
                     User::where('uid', $spread['uid'])->inc('brokerage_price', $bdjl)->update();
                     User::where('uid', $spread['uid'])->inc('brokerage_price', $bdjl)->update();
                 }
                 }
-                User::where('uid', $spread['uid'])->inc('stock_right', 2)->update();
+                User::where('uid', $spread['uid'])->inc('stock_right', 1)->update();
             }
             }
         }
         }
     }
     }