0

如何在 PHP 中使用 cron 一个月后自动删除作业

public function deletejobs()
    {
        $qry="select *from jobs where job_posting_date <unix_timestamp(now()-interval 31 day)";
        $res=$this->db->query($qry)->result_array();
        foreach($res as $result){
            $this->db->where('jobid',$result['jobid'])->update('jobs',array('job_status'=>expired));
        }
        //exit;
        redirect(base_url());


        $this->template->write_view('content', 'Jobs/job_center',$data);
        $this->template->render();
    }   
4

0 回答 0