public function check_state_common($request_method, $need_login = FALSE) { if (isset($request_method)) { $cur_req_method = $this->input->method(TRUE); $request_method = strtoupper($request_method); if ($cur_req_method != $request_method) { ishow_404('required method is \'' . $request_method . '\', but now is \'' . $cur_req_method . '\''); } } if ($need_login) { if (!is_login()) { // 如果没有登录 redirect(base_url('admin/login')); } } }
private function rent_item($hid) { if (!isset($hid)) { ishow_404('请指定房源'); } $this->load->model('renthouse_model'); $renthouse = $this->renthouse_model->get_single_by_hid($hid); if (!isset($renthouse) || empty($renthouse)) { ishow_404('找不到房源'); } $this->cat = HOUSE_CAT_RENT; loadRentCommonInfos($this); $this->house = parse_rent_house_item($this, $renthouse); unloadRentCommonInfos($this); // print_r($this->house); $this->load->view('portal/rent-info', $this); }
private function sell_item($hid) { if (!isset($hid) || !is_numeric($hid)) { ishow_404('请指定房源'); } $this->load->model('sellhouse_model'); $sellhouse = $this->sellhouse_model->get_single_by_hid($hid); if (!isset($sellhouse) || empty($sellhouse)) { ishow_404('找不到房源'); } $this->cat = HOUSE_CAT_SELL; loadCommonInfos($this); $this->house = parse_sell_house_item($this, $sellhouse); unloadCommonInfos($this); // print_r($this->house); $this->load->view('portal/sell-info', $this); }