Pārlūkot izejas kodu

资产变动明细

afa 8 mēneši atpakaļ
vecāks
revīzija
05e9be1991
1 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. 7 7
      application/api/controller/Ledger.php

+ 7 - 7
application/api/controller/Ledger.php

@@ -57,12 +57,8 @@ class Ledger extends Api
     {
         $type_id  = $this->request->post('query.action'); // 账变类型
         $coin_type  = $this->request->post('query.coin_type'); // 資金类型
-        $where = [
-            'user_id' => $this->auth->getTokenUserID(),
-        ];
-        if ($type_id > 0) {
-            $where['action'] = $type_id;
-        }
+        $where = ['user_id' => $this->auth->getTokenUserID()];
+        if ($type_id > 0) $where['action'] = $type_id;
         switch ($coin_type){
             case 'usdt':
                 $paginator = (new LedgerUsdtChangeModel());
@@ -89,7 +85,11 @@ class Ledger extends Api
                 $this->error(__('Invalid parameters'));
                 break;
         }
-        $res['data'] = $paginator->where($where)->order('id DESC')->paginate($this->pageSize);
+        $res['data'] = $paginator->alias('a')
+        ->join('user u', 'a.user_id = u.id and a.action > 9 and a.action < 12', 'LEFT')
+        ->field('a.*, u.address')
+        ->where($where)
+        ->order('a.id DESC')->paginate($this->pageSize);
         $res['statusList'] = LedgerWalletModel::getStatusList();
         $this->success('',$res);
     }