function getAvailableCourseAction() { $request = $this->getRequest(); if ('POST' == $request->getMethod()) { $userId = $this->post()->get("userId"); $domainId = $this->post()->get("domainId"); } else { $userId = $this->get("userId"); $domainId = $this->get("domainId"); } if (!$userId || !$domainId) { $this->displayJsonUdo(Common_Error::ERROR_PARAM); } $tradeModel = new TradeModel(); //$parent = $tradeModel->getParentId($localId,$domainId,$localType); //$parentId = $parent['parent_id']; $result = $tradeModel->getAvailableRes($userId, $domainId); //print_r($result); if ($result == -1) { $this->displayJsonUdo(Common_Error::ERROR_NO_AVAILABLE, "", "当前条件下没有可购买的课程哦~"); } $this->displayJsonUdo(Common_Error::ERROR_SUCCESS, $result); }