/** * * * @throws Api_Model_Exception */ public function showAction() { $id = $this->getRequest()->getParam('id'); if (!$id) { throw new Api_Model_Exception('', Api_Model_Exception::E_PARAM_REQUIRED); } $ids = explode(',', $id); $mAntique = new Application_Model_Antique(); $mAntique->setWithActivity()->setWithPhoto(); foreach ($ids as $id) { $rs[] = $mAntique->getOneById($id); } echo json_encode($rs); }
/** * 详情页 * */ public function showAction() { $id = $this->getRequest()->getParam('id'); if (!$id) { throw new Zend_Controller_Exception(); } $mAntique = new Application_Model_Antique(); $mAntique->setWithActivity()->setWithCompany()->setWithSubActivity()->setWithPhoto(); $this->view->antique = $mAntique->getOneById($id); // random antiques $condition = array('activity_id' => $this->similarAntiqueActivityId); $rs = $mAntique->getSearch($condition, 4, 0, 'random'); $this->view->antiquesRandom = $rs['data']; }