From 465e5ead8a42110814d52ebff03131042c92ccb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Sat, 18 Jul 2020 09:33:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=BA0=E5=88=99=E4=B8=8D?= =?UTF-8?q?=E9=99=90=E5=88=B6=E7=8F=AD=E7=BA=A7=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/common.php b/app/common.php index 2f4a9c2c..1f82e6f2 100644 --- a/app/common.php +++ b/app/common.php @@ -56,7 +56,20 @@ // 班级列表 function banJiNamelist() { - $cnfMax = config('shangma.classmax'); + $banji = new \app\teach\model\Banji; + $max = $banji->where('status', 1)->max('paixu'); + $cnfMax = config('shangma.classmax'); + $cnt = 0; + $max > $cnfMax ? $cnt = $max : $cnt = $cnfMax; + + $bjarr = array(); + for($i = 1; $i <= $cnt; $i++) + { + $bjarr[$i] = numToWord($i) . '班'; + } + return $bjarr; + + $cnfMax = config('shangma.classmax'); $bjarr = array(); for($i = 1; $i <= $cnfMax; $i++) {