where('id', '=', $id)->orWhere('flag', '=', $id); }; $post = cache("index_ad_detail_$id"); if (!$post) { $time = time(); $post = DB::table('ad')->where($where)->first(); if (!$post) { exit('not found'); } if ($post->is_expire == 1 && $post->end_time < $time) { exit('expired'); } cache("index_ad_detail_$id", $post, 2592000); } if (Helper::is_mobile_access()) { if ($post->content_wap) { exit($post->content_wap); } } exit($post->content); } }