parent
048fc8ecf2
commit
17a2cc31df
|
|
@ -23,7 +23,6 @@ class ExchangeQuotaDao extends BaseDao{
|
||||||
*/
|
*/
|
||||||
public function searchModel(array $params){
|
public function searchModel(array $params){
|
||||||
$quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡)
|
$quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡)
|
||||||
$quotaType = in_array((int)$quotaType,[1,2,3,4]) ? $quotaType : 1;// 类型非法,使用默认类型
|
|
||||||
|
|
||||||
return (new ExchangeQuota())
|
return (new ExchangeQuota())
|
||||||
->where('quota_type', $quotaType)
|
->where('quota_type', $quotaType)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ class ExchangeQuotaRecordDao extends BaseDao{
|
||||||
*/
|
*/
|
||||||
public function searchModel(array $params){
|
public function searchModel(array $params){
|
||||||
$quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡)
|
$quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡)
|
||||||
$quotaType = in_array((int)$quotaType,[1,2,3,4]) ? $quotaType : 1;// 类型非法,使用默认类型
|
|
||||||
|
|
||||||
return (new ExchangeQuotaRecord())
|
return (new ExchangeQuotaRecord())
|
||||||
->where('quota_type', $quotaType)
|
->where('quota_type', $quotaType)
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,15 @@ class ExchangeQuota extends BaseController
|
||||||
$params = $this->request->params(['quota_type']);
|
$params = $this->request->params(['quota_type']);
|
||||||
$statInfo = app()->make(ExchangeQuotaRepository::class)->getStat($params);
|
$statInfo = app()->make(ExchangeQuotaRepository::class)->getStat($params);
|
||||||
|
|
||||||
|
$quotaType = $params['quota_type'] ?? 1;
|
||||||
|
$quotaTitle = $quotaType == 5 ? '积分' : '额度';
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
['className' => 'el-icon-coin','count' => $statInfo['sum_total_quota'],'field' => '分','name' => '平台总额度'],
|
['className' => 'el-icon-coin','count' => $statInfo['sum_total_quota'],'field' => '分','name' => '平台总'.$quotaTitle],
|
||||||
['className' => 'el-icon-coin','count' => $statInfo['sum_use_quota'],'field' => '分','name' => '平台已使用额度'],
|
['className' => 'el-icon-coin','count' => $statInfo['sum_use_quota'],'field' => '分','name' => '平台已使用'.$quotaTitle],
|
||||||
['className' => 'el-icon-coin','count' => $statInfo['sum_surplus_quota'],'field' => '分','name' => '平台剩余额度'],
|
['className' => 'el-icon-coin','count' => $statInfo['sum_surplus_quota'],'field' => '分','name' => '平台剩余'.$quotaTitle],
|
||||||
['className' => 'el-icon-coin','count' => $statInfo['sum_freeze_quota'],'field' => '分','name' => '平台冻结额度'],
|
['className' => 'el-icon-coin','count' => $statInfo['sum_freeze_quota'],'field' => '分','name' => '平台冻结'.$quotaTitle],
|
||||||
['className' => 'el-icon-coin','count' => $statInfo['sum_people_num'],'field' => '分','name' => '参与人数'],
|
// ['className' => 'el-icon-coin','count' => $statInfo['sum_people_num'],'field' => '分','name' => '参与人数'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue