WIN-2308041133\Administrator 4 달 전
부모
커밋
a2afc636d2

+ 1 - 1
app/common/repositories/user/UserBillRepository.php

@@ -39,7 +39,7 @@ class UserBillRepository extends BaseRepository
     const TYPE_INFO = [
         'brokerage' => [
             'brokerage/now_money' => '佣金转入余额',
-            'brokerage/extract_award' => '提取奖金',
+            'brokerage/extract_award' => '分红积分兑换',
             'brokerage/order_one' => '获得一级推广佣金',
             'brokerage/order_two' => '获得二级推广佣金',
             'brokerage/refund_one' => '退还一级佣金',

+ 17 - 1
app/common/repositories/user/UserExtractRepository.php

@@ -427,6 +427,17 @@ class UserExtractRepository extends BaseRepository
     }
 
 
+    /**
+     * 获取用户的历史银行卡信息
+     *
+     * 本函数用于查询指定用户的历史银行卡记录。它通过用户的UID来检索数据,
+     * 仅返回提取类型为0的记录,这通常表示用户的存款记录。返回的数据包括
+     * 实名、银行代码、银行地址和银行名称,这些信息对于后续的银行相关操作
+     * 或用户查询非常有用。
+     *
+     * @param int $uid 用户ID。这是查询用户历史银行卡记录的关键标识。
+     * @return array 返回包含用户历史银行卡信息的数组。如果找不到相关信息,则返回空数组。
+     */
     /**
      * 获取用户的历史银行卡信息
      *
@@ -443,7 +454,12 @@ class UserExtractRepository extends BaseRepository
         // 使用DAO对象进行查询,指定查询条件为UID和提取类型为0,按创建时间降序排序,并指定返回的字段。
         return $this->dao->getSearch(['uid' => $uid, 'extract_type' => 0])->order('create_time DESC')->field('real_name,bank_code,bank_address,bank_name')->find();
     }
-
+    public function getHistory($uid,$where)
+    {
+        // 使用DAO对象进行查询,指定查询条件为UID和提取类型为0,按创建时间降序排序,并指定返回的字段。
+        return $this->dao->getSearch(['uid' => $uid, 'extract_type' => $where['type']])->order('create_time DESC')
+            ->field('real_name,bank_code,bank_address,bank_name,alipay_code,wechat,extract_pic')->find();
+    }
     /**
      * 根据ID获取详细信息
      * 此方法通过ID从数据库中获取特定记录的详细信息,包括用户信息,使用懒加载模式来加载用户信息,

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

@@ -142,5 +142,17 @@ class UserExtract extends BaseController
         app()->make(UserRepository::class)->extractIntegral($user['uid'],$where['num']);
         return app('json')->success('已提现至佣金');
     }
-
+    /**
+     * 历史提现数据
+     * @return \think\response\Json
+     * @author wuhaotian
+     * @email 442384644@qq.com
+     * @date 2024/7/10
+     */
+    public function history()
+    {
+        $where= $this->request->params(['type']);
+        $data = $this->repository->getHistoryBank($this->request->userInfo()->uid,$where);
+        return app('json')->success($data ?? []);
+    }
 }

+ 1 - 0
route/api.php

@@ -148,6 +148,7 @@ Route::group('api/', function () {
             Route::get('/extract/banklst', 'UserExtract/bankLst');
             Route::post('/extract/create', 'UserExtract/create');
             Route::get('/extract/history_bank', 'UserExtract/historyBank');
+            Route::get('/extract/history', 'UserExtract/history');
 
             //绑定手机号
             Route::post('binding', 'User/binding');