|
|
@@ -50,7 +50,7 @@ class Ledger extends Api
|
|
|
* 资产变动明细
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function coinList()
|
|
|
+ public function coinList( LedgerWalletModel $ledgerWalletModel)
|
|
|
{
|
|
|
$type_id = $this->request->post('query.action'); // 账变类型
|
|
|
$coin_type = $this->request->post('query.coin_type'); // 資金类型
|
|
|
@@ -67,16 +67,13 @@ class Ledger extends Api
|
|
|
case 'power':
|
|
|
$paginator = (new LedgerPowerChangeModel());
|
|
|
break;
|
|
|
-// case 'server':
|
|
|
-// $paginator = (new LedgerServersPowerChangeModel());
|
|
|
-// break;
|
|
|
case 'declaration':
|
|
|
$paginator = (new LedgerDeclarationChange());
|
|
|
break;
|
|
|
case 'etc':
|
|
|
$paginator = (new LedgerTokenChangeModel());
|
|
|
break;
|
|
|
- case 'aleo':
|
|
|
+ case 'token':
|
|
|
$paginator = (new LedgerTokenChangeModel());
|
|
|
break;
|
|
|
case 'smh':
|
|
|
@@ -89,24 +86,11 @@ class Ledger extends Api
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
- $paginator = $paginator->where($where)->order('id DESC')->paginate($this->pageSize);
|
|
|
- foreach ($paginator as $key => $item){
|
|
|
- $paginator[$key]['change_amount'] = round($item['change_amount'], 4);
|
|
|
- $paginator[$key]['present_amount'] = round($item['present_amount'], 4);
|
|
|
- if($coin_type == 'smh'){
|
|
|
- $paginator[$key]['action_name'] = (new LedgerSmhChangeModel())->pay_status[$item['action']];
|
|
|
- }elseif($coin_type == 'qubic'){
|
|
|
- $paginator[$key]['action_name'] = (new LedgerQubicChangeModel())->aciton_name[$item['action']];
|
|
|
- }elseif($coin_type == 'aleo'){
|
|
|
- $paginator[$key]['action_name'] = (new LedgerTokenChangeModel())->aciton_name[$item['action']];
|
|
|
- }else{
|
|
|
- $paginator[$key]['action_name'] = Action::getText($item['action']);
|
|
|
- }
|
|
|
- }
|
|
|
- $res = $this->buildResp($paginator->total(), $paginator->currentPage(), $paginator->items());
|
|
|
+ $res['data'] = $paginator->where($where)->order('id DESC')->paginate($this->pageSize);
|
|
|
+ $res['statusList'] = LedgerWalletModel::getStatusList();
|
|
|
$this->success('',$res);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 资产变动类型
|
|
|
* @return void
|