From 17a2cc31df4d23ae4d7426c75b5d9dadbe7f763a Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Mon, 1 Jul 2024 09:48:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E9=85=92=E6=B0=B4=E5=8D=A1=E9=A2=9D=E5=BA=A6=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=99=90=E5=88=B6=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=9A=E5=85=BC=E5=AE=B9=E9=A2=9D=E5=BA=A6=E5=92=8C=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E6=96=87=E5=AD=97=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/user/ExchangeQuotaDao.php | 1 - app/common/dao/user/ExchangeQuotaRecordDao.php | 1 - app/controller/admin/user/ExchangeQuota.php | 13 ++++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/common/dao/user/ExchangeQuotaDao.php b/app/common/dao/user/ExchangeQuotaDao.php index b6fb675..cd9da5c 100644 --- a/app/common/dao/user/ExchangeQuotaDao.php +++ b/app/common/dao/user/ExchangeQuotaDao.php @@ -23,7 +23,6 @@ class ExchangeQuotaDao extends BaseDao{ */ public function searchModel(array $params){ $quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡) - $quotaType = in_array((int)$quotaType,[1,2,3,4]) ? $quotaType : 1;// 类型非法,使用默认类型 return (new ExchangeQuota()) ->where('quota_type', $quotaType) diff --git a/app/common/dao/user/ExchangeQuotaRecordDao.php b/app/common/dao/user/ExchangeQuotaRecordDao.php index 65cae76..39ab3e6 100644 --- a/app/common/dao/user/ExchangeQuotaRecordDao.php +++ b/app/common/dao/user/ExchangeQuotaRecordDao.php @@ -23,7 +23,6 @@ class ExchangeQuotaRecordDao extends BaseDao{ */ public function searchModel(array $params){ $quotaType = $params['quota_type'] ?? 1;// 存在指定类型则使用指定类型,否则使用默认类型(默认酒卡) - $quotaType = in_array((int)$quotaType,[1,2,3,4]) ? $quotaType : 1;// 类型非法,使用默认类型 return (new ExchangeQuotaRecord()) ->where('quota_type', $quotaType) diff --git a/app/controller/admin/user/ExchangeQuota.php b/app/controller/admin/user/ExchangeQuota.php index 5e9f240..24ddb4a 100644 --- a/app/controller/admin/user/ExchangeQuota.php +++ b/app/controller/admin/user/ExchangeQuota.php @@ -25,12 +25,15 @@ class ExchangeQuota extends BaseController $params = $this->request->params(['quota_type']); $statInfo = app()->make(ExchangeQuotaRepository::class)->getStat($params); + $quotaType = $params['quota_type'] ?? 1; + $quotaTitle = $quotaType == 5 ? '积分' : '额度'; + $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' => '参与人数'], + ['className' => 'el-icon-coin','count' => $statInfo['sum_total_quota'],'field' => '分','name' => '平台总'.$quotaTitle], + ['className' => 'el-icon-coin','count' => $statInfo['sum_use_quota'],'field' => '分','name' => '平台已使用'.$quotaTitle], + ['className' => 'el-icon-coin','count' => $statInfo['sum_surplus_quota'],'field' => '分','name' => '平台剩余'.$quotaTitle], + ['className' => 'el-icon-coin','count' => $statInfo['sum_freeze_quota'],'field' => '分','name' => '平台冻结'.$quotaTitle], + // ['className' => 'el-icon-coin','count' => $statInfo['sum_people_num'],'field' => '分','name' => '参与人数'], ]; return app('json')->success($data);