From 24a519918e10ed8670571dce97c7269e445cdfa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Sun, 6 Sep 2020 17:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E6=9F=A5=E8=AF=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=8F=AD=E4=B8=BB=E4=BB=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/model/TongjiBj.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 68b45587..b85e8e5b 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -397,6 +397,9 @@ class TongjiBj extends BaseModel $src['enddate'] = date("Y-m-d",strtotime("+1 day")); } + $bj = new \app\teach\model\Banji; + $bjList = $bj->where('banzhuren', $src['teacher_id'])->column('id'); + $data = $this->where('teacher_id', $src['teacher_id']) ->where('subject_id', '<>', 0) ->when(count($src['subject_id']) > 0, function ($query) use($src) { @@ -417,6 +420,14 @@ class TongjiBj extends BaseModel }) ->field('id'); }) + ->when(count($bjList) > 0, function ($query) use($bjList) { + $query->whereOr('id', 'in', function ($q) use($bjList) { + $q->name('tongjiBj') + ->where('banji_id', 'in', $bjList) + ->where('subject_id', '<>', 0) + ->field('id'); + }); + }) ->with([ 'bjSubject' => function ($query) { $query->field('id, title, jiancheng');