request->param('id/d', 0); $ad = $id ? AdModel::find($id) : null; if (!$ad || (int)$ad->type !== 1 || !$ad->url) { return redirect('/haonav/index.html'); } AdModel::where('id', $id)->inc('click_count')->update(); return redirect($ad->url); } }