处理一定时间内未支付的订单

// 处理一定时间内未支付的订单
// ( (create_at=created_at+1200 <= now_time) == (create_at <= now_time - 1200) )
$datetime = date("Y-m-d H:i:s", time() - 1200);
Order::where('status', 0)->where('created_at', '<=', $datetime)->update(['valid'=>0]);