public function onRun() { //$this->addJs(CLF_ASSETS . '/js/helpers/ad-cache.js'); //$this->addJs(CLF_ASSETS . '/js/helpers/ad-helper.js'); //$this->addJs(CLF_ASSETS . '/js/components/ad-detail.js'); $ad = $this->loadAd(); $this->page['nearbies'] = Ad::getNearbyAd($ad_id); $state_id = 0; foreach ($ad_tags as $tag) { if ($tag->type == 'state') { $state_id = $tag->tag_id; } } $this->page['nearby_states'] = Ad::getAdAroundState($state_id, $ad_id); }
public function getNearby($id) { $data = get(); $default = array('page' => 0); $merge = array_merge($default, $data); $merge = \DLNLab\Classified\Classes\HelperClassified::trim_value($merge); extract($merge); $records = Ad::getNearbyAd(intval($id), intval($page)); return Response::json(array('status' => 'success', 'data' => $records)); }