WIN-2308041133\Administrator 5 ヶ月 前
コミット
30adf3efa3
2 ファイル変更15 行追加1 行削除
  1. 14 0
      app/controller/api/user/User.php
  2. 1 1
      route/api.php

+ 14 - 0
app/controller/api/user/User.php

@@ -238,6 +238,20 @@ class User extends BaseController
             'category' => 'award_integral'
         ], $this->request->uid(), $page, $limit));
     }
+    /**
+     * 用户分红积分提现
+     * @return \think\response\Json
+     */
+    public function award_create()
+    {
+        $user = $this->request->userInfo();
+        $where= $this->request->params(['num']);
+        if ($where['num'] <= $user['award_integral']){
+            throw new \Exception('提现积分不能大于可拥有积分');
+        }
+        app()->make(UserRepository::class)->extractIntegral($user['uid'],$where['num']);
+        return app('json')->success('已提现至佣金');
+    }
     /**
      * @return mixed
      * @throws DataNotFoundException

+ 1 - 1
route/api.php

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