This commit is contained in:
weiz 2024-05-29 10:27:24 +08:00
parent f0fe4f33d1
commit bf7877a3cf
2 changed files with 19 additions and 1 deletions

View File

@ -10,7 +10,22 @@
public function index(){
$oa_plan = OaPlan::where('is_remind',0)->where('remind_type','>',0)->select()->toArray();
foreach ($oa_plan as $v){
$date = match($v['remind_type']){
1=>'5分钟',2=>'15分钟',3=>'30分钟',4=>'1小时',5=>'2小时',6=>'1天'
};
if(time() > strtotime($v['remind_time'])){
Db::name('oa_message')->insert([
'title' => '您有一条新的日程安排提醒',
'template' => 0,
'content' => '您的日程安排还有'.$date.'开始,请合理安排时间',
'from_uid' => 0,
'to_uid' => $v['admin_id'],
'type' => 1,
'send_time' => time(),
'status' => 1,
'is_draft' => 1,
]);
}
}
}
}

View File

@ -19,6 +19,9 @@
return $this->fail("参数错误");
}
$where = [];
if($params['type'] == 1){
$where[] = ['check_status','in','0,1,2,3,4'];
}
if($params['type'] == 2){
$where[] = ['check_status','=',0];
}