From e7c50fdf6b89b6b4a96803fe6c7a6f343204412b Mon Sep 17 00:00:00 2001 From: cmz Date: Mon, 2 Sep 2024 17:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A6=82=E8=A7=88=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A4=9A=E4=BD=8D=E5=B0=8F=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Metrics/Examples/FullPaymentRate.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Admin/Metrics/Examples/FullPaymentRate.php b/app/Admin/Metrics/Examples/FullPaymentRate.php index afcae76..5b8f373 100644 --- a/app/Admin/Metrics/Examples/FullPaymentRate.php +++ b/app/Admin/Metrics/Examples/FullPaymentRate.php @@ -5,6 +5,7 @@ use App\Models\AdmissionNewStudents; use App\Models\CompletedOfflineStep; use App\Models\Config; use App\Models\OfflineStep; +use App\Models\Order; use App\Models\PaymentList; use App\Models\UsersMember; use Dcat\Admin\Widgets\Metrics\Card; @@ -51,12 +52,12 @@ class FullPaymentRate extends Card ])->first(); //当前年份已完成二级学院扫码的学生(实际报道人数) - $allCount = CompletedOfflineStep::query()->where([ + /*$allCount = CompletedOfflineStep::query()->where([ "annual_session" => $config->data, ])->select("unique_number")->distinct()->get()->toArray(); if(!empty($allCount)){ $number = count($allCount); - } + }*/ @@ -83,6 +84,14 @@ class FullPaymentRate extends Card $studentsNum = count($paymentList); + //已缴费人数 + $payNum = Order::query()->whereIn("unique_number", $userList)->where([ + "status" => Order::STATUS_PAID, + "annual_session" => $config->data, + ])->select("unique_number")->groupBy('unique_number')->get()->toArray(); + if(!empty($payNum)){ + $number = count($payNum); + } } }