WIN-2308041133\Administrator 6 miesięcy temu
rodzic
commit
49977ad157

+ 0 - 1
app/common/repositories/store/order/StoreOrderRepository.php

@@ -1212,7 +1212,6 @@ class StoreOrderRepository extends BaseRepository
                         'mark' => $user['nickname'] . '成功消费礼包商品' . floatval($order['pay_price']) . '元,奖励上级分红积分' . $order_award_range,
                     ]);
                     break;
-                    continue;
             }
             User::where('uid', $user['spread_uid'])->update(['award_integral'=>$after]);
         }

+ 12 - 1
app/controller/api/user/UserExtract.php

@@ -12,6 +12,7 @@
 
 namespace app\controller\api\user;
 
+use app\common\repositories\user\UserRepository;
 use crmeb\basic\BaseController;
 use app\common\repositories\system\groupData\GroupDataRepository;
 use think\App;
@@ -127,6 +128,16 @@ class UserExtract extends BaseController
         $data = $this->repository->getHistoryBank($this->request->userInfo()->uid);
         return app('json')->success($data ?? []);
     }
-
+    /**
+     * 用户分红积分提现
+     * @return \think\response\Json
+     */
+    public function awardCreate()
+    {
+        $user = $this->request->userInfo();
+        $where= $this->request->params(['num']);
+        app()->make(UserRepository::class)->extractIntegral($user['uid'],$where['num']);
+        return app('json')->success('已提现至佣金');
+    }
 
 }

+ 2 - 0
route/api.php

@@ -207,6 +207,8 @@ Route::group('api/', function () {
             Route::get('award/integral_list', 'User/award_integral_list');
             //分红份额明细
             Route::get('award/range_list', 'User/award_range_list');
+//            分红积分提现
+            Route::post('/award/create', 'UserExtract/awardCreate');
         })->prefix('api.user.');
 
         //购物车