12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\cron;
- use app\common\util\AppMsg;
- use think\Db;
- use yunwuxin\cron\Task;
- class Meeting extends Task
- {
- public function configure()
- {
- $this->everyMinute();
- }
-
- protected function execute()
- {
- try {
- $this->remind();
- } catch (\Exception $e) {
- trace($e->getMessage());
- }
- }
- public function remind(){
- $curTime = time() - 30*60;
- $lists = Db::name('meeting_apply')
- ->where('status',1)
- ->where('del',0)
- ->where('start_time',date('Y-m-d H:i:00',$curTime))
- ->field('id,org_id,user_ids')
- ->select();
- foreach ($lists as $k=>$v){
- $uids = $v['user_ids']?explode(',',$v['user_ids']):[];
- if($uids){
- send_jpush($uids,AppMsg::PUSH_CUSTOM,'您有会议将要开始,请做好准备!');
- }
- }
- }
- }
|