function _getConditions($conditions, $if_add_alias = false) { $alias = ''; if ($if_add_alias) { $alias = $this->alias . '.'; } $res = parent::_getConditions($conditions, $if_add_alias); return $res ? $res . " AND {$alias}store_id = '{$this->_store_id}'" : " WHERE {$alias}store_id = '{$this->_store_id}'"; }
public function view($id) { $event_model = new EventsModel(); $user_model = new UsersModel(); $recommend_model = new RecommendModel(); $media_model = new MediaModel(); $event = $event_model->find($id); $user = $user_model->find($event['user_id']); $recommended_users = $recommend_model->users_by_event($id); $recommended_events = $recommend_model->events_by_event($id); $images = $media_model->select_images_by_event($id); $this->assign('images', $images); $this->assign('event', $event); $this->assign('user', $user); $this->assign('rec_users', $recommended_users); $this->assign('rec_events', $recommended_events); $this->display(); }
public function home_recommend() { $recommend_model = new RecommendModel(); $this->assign('results', $recommend_model->recommend()); $this->display(); }