afa před 5 měsíci
rodič
revize
3b4aa16535

+ 3 - 0
application/api/controller/Pledge.php

@@ -79,6 +79,9 @@ class Pledge extends Api
       */
       public function create(ProductPledges $productPledges, PledgeLogic $pledgeLogic, LedgerWalletModel $ledgerWalletModel)
       {
+
+
+          //  dump(CommonLogic::setIsUpLevel(1477, 0, 3));die;
         $pledge_id  = $this->request->post('pledge_id', 0, 'intval');
         $order_id   = $this->request->post('order_id/a', '');
         $pay_type   = $this->request->post('pay_type/d', 1);//支付方式 1 茶宝 2 Teac

+ 2 - 2
application/api/logic/CommonLogic.php

@@ -50,7 +50,7 @@ class CommonLogic
             $userPledge = Loader::model('UserPledge');
             foreach ($pathId as $item) 
             {
-                  $parent = $userModel::where('parent_id', $item)->find();
+                  $parent = $userModel::where('id', $item)->find();
                   if($parent->team_level_id > 0){
                         //推广人数
                         $teamCount = $userModel::where('parent_id', $item)->where('team_level_id', $parent->team_level_id)->count() +1;
@@ -97,7 +97,7 @@ class CommonLogic
             $userPledge= Loader::model('UserPledge');
             foreach ($pathId as $item) 
             {
-                  $parent = $userModel::where('parent_id', $item)->find();
+                  $parent = $userModel::where('id', $item)->find();
                   if($parent->team_level_id > 0){
                         //推广人数
                         $teamCount = $userModel::where('parent_id', $item)->where('team_level_id', $parent->team_level_id)->count()-1;