From 532151cf6259708b959cf28d16854e62b5863345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Mon, 8 Nov 2021 21:43:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=99=E7=A0=94=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/teach/model/JiaoyanZuzhang.php | 1 + app/teach/model/Jiaoyanzu.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/teach/model/JiaoyanZuzhang.php b/app/teach/model/JiaoyanZuzhang.php index 6d61d619..0f646d2d 100644 --- a/app/teach/model/JiaoyanZuzhang.php +++ b/app/teach/model/JiaoyanZuzhang.php @@ -94,6 +94,7 @@ class JiaoyanZuzhang extends Model public function srcTeacherNow($admin_id) { $teacher = $this->where('teacher_id', $admin_id) + ->whereTime('bfdate', '<=', time()) ->order(['bfdate'=>'desc']) ->field('jiaoyanzu_id ,any_value(teacher_id) as teacher_id diff --git a/app/teach/model/Jiaoyanzu.php b/app/teach/model/Jiaoyanzu.php index 7f2fa1e4..d0b956bc 100644 --- a/app/teach/model/Jiaoyanzu.php +++ b/app/teach/model/Jiaoyanzu.php @@ -156,14 +156,15 @@ class Jiaoyanzu extends BaseModel { $zh = new \app\teach\model\JiaoyanZuzhang; $zhInfo = $zh->where('jiaoyanzu_id', $this->id) + ->where('bfdate', '<=', time()) ->order(['bfdate' => 'desc']) ->with([ 'glTeacher' => function ($query) { $query->field('id, xingming'); } ]) - ->find(); - + ->find(); + $str = ['id', 'xingming']; if ($zhInfo) { $str = [