<?php
namespace Active\Lib;

Use Dever;
Class Cron{
	#活动订单定时关闭
    public function job_api(){
    	$data = Dever::db('active/order')->state(array('status'=>1));
    	$time = time();
    	if($data){
    		foreach($data as $k => $v){
    			if ($v['cdate'] && $time-$v['cdate']>300){
    				Dever::db('active/order')->update(array('where_id'=>$v['id'],'set_status'=>3));
    			}
    		}
    	}
    	return 'ok';
    }
}