/** * 获取商家认证图片 * @param $id * @param $type * @return mixed */ public function getCertImg($id, $type) { // $cert = Certification::where('user_id', '=', Auth::user()->id)->firstOrFail(); $cert = Certification::where('user_id', '=', $id)->firstOrFail(); switch ($type) { case 'icf': $path = base_path() . '/storage/certfiles/' . $cert->identity_card_front; break; case 'icb': $path = base_path() . '/storage/certfiles/' . $cert->identity_card_back; break; case 'bl': $path = base_path() . '/storage/certfiles/' . $cert->business_license; break; } if (file_exists($path)) { return Response::inline($path); } }