From 7cafe46a06f304c4fad41df33f67873ea07d45d5 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 16 Jan 2024 15:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/project/controller/Project.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/project/controller/Project.php b/application/project/controller/Project.php index d6b6c03..bb8d878 100755 --- a/application/project/controller/Project.php +++ b/application/project/controller/Project.php @@ -588,7 +588,9 @@ class Project extends BasicApi } $data=[]; foreach($select as $k=>$v){ - $find=Db::name('positioning')->where(['member_code'=>$v['member_code']])->whereTime('date','today')->order('date desc')->field('positioning,date,end_date')->find(); + $date=date('Y-m-d H:i:s'); + $end=date('Y-m-d H:i:s',time()-300); + $find=Db::name('positioning')->where(['member_code'=>$v['member_code']])->whereTime('date',[$end,$date])->order('date desc')->field('positioning,date,end_date')->find(); $data[$k]=[ 'name'=>$v['name'], 'avatar'=>$v['avatar'], @@ -629,7 +631,7 @@ class Project extends BasicApi if($date==''){ $date=date('Y-m-d H:i:s'); $end=date('Y-m-d H:i:s',time()-300); - $select=Db::name('positioning')->where(['member_code'=>$code])->whereTime('date',[$end,$date])->column('positioning'); + $select=Db::name('positioning')->where(['member_code'=>$code])->whereTime('date',[$end,$date])->fetchSql(true)->column('positioning'); }else{ $select=Db::name('positioning')->where(['member_code'=>$code])->whereBetweenTime('date',$date)->column('positioning'); }