Ejemplo n.º 1
0
 /**
  * action_id : 2306
  * 学员在APP中对自己的课时进行请假或者取消请假的操作
  * @param userId        -- 用户ID
  * @param token         -- 用户验证token
  * @param memberId      -- 用户当前绑定的学员所对应的ID
  * @param lessonStudentId  -- 课程的唯一排课编号
  * @param leaveType            -- 请假类型 1表示请假,2表示取消请假
  * @return result          调用返回结果
  * @return msg             调用返回结果说明
  * @return data             调用返回数据
  */
 public function actionLessonStudentLeave()
 {
     // 检查参数
     if (!isset($_REQUEST['userId']) || !isset($_REQUEST['token']) || !isset($_REQUEST['memberId']) || !isset($_REQUEST['lessonStudentId']) || !isset($_REQUEST['leaveType'])) {
         $this->_return('MSG_ERR_LESS_PARAM');
     }
     $userId = Yii::app()->request->getParam('userId', NULL);
     $token = Yii::app()->request->getParam('token', NULL);
     $memberId = Yii::app()->request->getParam('memberId', NULL);
     $lessonStudentId = Yii::app()->request->getParam('lessonStudentId', NULL);
     $leaveType = Yii::app()->request->getParam('leaveType', NUll);
     $aType = array(1, 2);
     if (!in_array($leaveType, $aType)) {
         $this->_return('MSG_ERR_LEAVE_TYPE');
     }
     $data = HtLessonStudent::model()->lessonStudentLeave($userId, $token, $memberId, $lessonStudentId, $leaveType);
     if ($data === 20008) {
         $this->_return('MSG_ERR_FAIL_USER');
     } elseif ($data === 20007) {
         $this->_return('MSG_ERR_FAIL_TOKEN');
     } elseif ($data === 20017) {
         $this->_return('MSG_ERR_FAIL_MEMBER');
     } elseif ($data === 20021) {
         $this->_return('MSG_ERR_LESSON_STUDENT_ID');
     } elseif ($data === 20031) {
         $this->_return('MSG_ERR_LEAVE_TYPE');
     } elseif ($data === 20032) {
         $this->_return('MSG_ERR_NO_LEAVE');
     } elseif ($data === 20033) {
         $this->_return('MSG_ERR_NO_CANCEL_LEAVE');
     }
     // TODO : add log
     $actionId = 2306;
     $params = '';
     foreach ($_REQUEST as $key => $value) {
         $params .= $key . '=' . $value . '&';
     }
     LogUserAction::model()->userAction($userId, $actionId, $params);
     $this->_return('MSG_SUCCESS', $data);
 }
Ejemplo n.º 2
0
 /**
  * 学员在APP中对自己的课时进行请假或者取消请假的操作
  * @param userId        -- 用户ID
  * @param token         -- 用户验证token
  * @param memberId      -- 用户当前绑定的学员所对应的ID
  * @param lessonStudentId  -- 课程的唯一排课编号
  * @param leaveType            -- 请假类型 1表示请假,2表示取消请假
  * @param issue                -- 预约补课时间
  * @return result          调用返回结果
  * @return msg             调用返回结果说明
  * @return data             调用返回数据
  */
 public function actionLessonStudentLeave()
 {
     // 检查参数
     if (!isset($_REQUEST['userId']) || !isset($_REQUEST['token']) || !isset($_REQUEST['memberId']) || !isset($_REQUEST['lessonStudentId']) || !isset($_REQUEST['leaveType']) || !isset($_REQUEST['issue'])) {
         $this->_return('MSG_ERR_LESS_PARAM');
     }
     $userId = Yii::app()->request->getParam('userId', NULL);
     $token = Yii::app()->request->getParam('token', NULL);
     $memberId = Yii::app()->request->getParam('memberId', NULL);
     $lessonStudentId = Yii::app()->request->getParam('lessonStudentId', NULL);
     $leaveType = Yii::app()->request->getParam('leaveType', NUll);
     $issue = Yii::app()->request->getParam('issue', NUll);
     $version = Yii::app()->request->getParam('version', NULL);
     $deviceId = Yii::app()->request->getParam('deviceId', NULL);
     $platform = Yii::app()->request->getParam('platform', NULL);
     $channel = Yii::app()->request->getParam('channel', NULL);
     $appVersion = Yii::app()->request->getParam('appVersion', NULL);
     $osVersion = Yii::app()->request->getParam('osVersion', NULL);
     $appId = Yii::app()->request->getParam('appId', NULL);
     $data = HtLessonStudent::model()->lessonStudentLeave($userId, $token, $memberId, $lessonStudentId, $leaveType, $issue);
     if ($data === 10010) {
         $this->_return('MSG_ERR_FAIL_USER');
     } elseif ($data === 10009) {
         $this->_return('MSG_ERR_FAIL_TOKEN');
     }
     // 记录log
     $this->_return('MSG_SUCCESS', $data);
 }