new-admin-api/app/controller/admin/user/ExchangeQuota.php

64 lines
2.1 KiB
PHP

<?php
namespace app\controller\admin\user;
use app\common\repositories\user\ExchangeQuotaRecordRepository;
use app\common\repositories\user\ExchangeQuotaRepository;
use crmeb\basic\BaseController;
class ExchangeQuota extends BaseController
{
protected $repository;
/**
* Common: 额度信息 - 统计
* Author: wu-hui
* Time: 2024/01/11 9:54
* @return mixed
*/
public function quotaTitle(){
$statInfo = app()->make(ExchangeQuotaRepository::class)->getStat();
$data = [
['className' => 'el-icon-coin','count' => $statInfo['sum_total_quota'],'field' => '分','name' => '平台总额度'],
['className' => 'el-icon-coin','count' => $statInfo['sum_use_quota'],'field' => '分','name' => '平台已使用额度'],
['className' => 'el-icon-coin','count' => $statInfo['sum_surplus_quota'],'field' => '分','name' => '平台剩余额度'],
['className' => 'el-icon-coin','count' => $statInfo['sum_freeze_quota'],'field' => '分','name' => '平台冻结额度'],
['className' => 'el-icon-coin','count' => $statInfo['sum_people_num'],'field' => '分','name' => '参与人数'],
];
return app('json')->success($data);
}
/**
* Common: 额度信息 - 额度持有信息
* Author: wu-hui
* Time: 2024/01/11 9:59
* @return mixed
*/
public function quotaList(){
[$page, $limit] = $this->getPage();
$params = $this->request->params(['uid']);
$data = app()->make(ExchangeQuotaRepository::class)->getList((array)$params,(int)$page,(int)$limit);
return app('json')->success($data);
}
/**
* Common: 额度信息 - 变更记录
* Author: wu-hui
* Time: 2024/01/11 10:02
* @return mixed
*/
public function quotaRecordList(){
[$page, $limit] = $this->getPage();
$params = $this->request->params(['uid']);
$data = app()->make(ExchangeQuotaRecordRepository::class)->getList((array)$params,(int)$page,(int)$limit);
return app('json')->success($data);
}
}