/** * 根据user_id查找头像 * @param integer $user_id * @return UserAvatar the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($user_id) { if (($model = UserAvatar::findOne(['user_id' => $user_id])) !== null) { return $model; } else { return null; } }