update
This commit is contained in:
parent
f0fe4f33d1
commit
bf7877a3cf
@ -10,7 +10,22 @@
|
|||||||
public function index(){
|
public function index(){
|
||||||
$oa_plan = OaPlan::where('is_remind',0)->where('remind_type','>',0)->select()->toArray();
|
$oa_plan = OaPlan::where('is_remind',0)->where('remind_type','>',0)->select()->toArray();
|
||||||
foreach ($oa_plan as $v){
|
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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,6 +19,9 @@
|
|||||||
return $this->fail("参数错误");
|
return $this->fail("参数错误");
|
||||||
}
|
}
|
||||||
$where = [];
|
$where = [];
|
||||||
|
if($params['type'] == 1){
|
||||||
|
$where[] = ['check_status','in','0,1,2,3,4'];
|
||||||
|
}
|
||||||
if($params['type'] == 2){
|
if($params['type'] == 2){
|
||||||
$where[] = ['check_status','=',0];
|
$where[] = ['check_status','=',0];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user