/**
  * 用户在APP中提交试听等相关的信息
  * @userId $userId
  * @name $name
  * @mobile $mobile
  * @subject $subject
  * @return result          调用返回结果
  * @return msg             调用返回结果说明
  * @return data             调用返回数据
  */
 public function actionPostAppointment()
 {
     if (!isset($_REQUEST['userId']) || !isset($_REQUEST['name']) || !isset($_REQUEST['mobile']) || !isset($_REQUEST['subject'])) {
         $this->_return('MSG_ERR_LESS_PARAM');
     }
     $userId = Yii::app()->request->getParam('userId', NULL);
     $name = Yii::app()->request->getParam('name', NULL);
     $mobile = Yii::app()->request->getParam('mobile', NULL);
     $subject = Yii::app()->request->getParam('subject', 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);
     if (!ctype_digit($userId)) {
         $this->_return('MSG_ERR_FAIL_USER');
     }
     if (!$this->isMobile($mobile)) {
         $this->_return('MSG_ERR_FAIL_MOBILE');
     }
     if (!ctype_digit($subject)) {
         $this->_return('MSG_ERR_FAIL_SUBJECT');
     }
     $data = ComAppointment::model()->postAppointment($userId, $name, $mobile, $subject);
     $this->_return('MSG_SUCCESS', $data);
 }
 /**
  * action_id : 2202
  * 用户在APP中提交试听等相关的信息,提交线索
  * @userId $userId
  * @name $name
  * @mobile $mobile
  * @subject $subject
  * @return result          调用返回结果
  * @return msg             调用返回结果说明
  * @return data             调用返回数据
  */
 public function actionPostAppointment()
 {
     if (!isset($_REQUEST['userId']) || !isset($_REQUEST['name']) || !isset($_REQUEST['mobile']) || !isset($_REQUEST['subject'])) {
         $this->_return('MSG_ERR_LESS_PARAM');
     }
     $userId = Yii::app()->request->getParam('userId', NULL);
     $name = Yii::app()->request->getParam('name', NULL);
     $mobile = Yii::app()->request->getParam('mobile', NULL);
     $subject = Yii::app()->request->getParam('subject', NUll);
     if (!ctype_digit($userId)) {
         $this->_return('MSG_ERR_FAIL_USER');
     }
     if (!$this->isMobile($mobile)) {
         $this->_return('MSG_ERR_FAIL_MOBILE');
     }
     if (!ctype_digit($subject)) {
         $this->_return('MSG_ERR_FAIL_SUBJECT');
     }
     $data = ComAppointment::model()->postAppointment($userId, $name, $mobile, $subject);
     if (!$data) {
         $this->_return('MSG_ERR_UNKOWN');
     }
     // TODO : add log
     $actionId = 2202;
     $params = '';
     foreach ($_REQUEST as $key => $value) {
         $params .= $key . '=' . $value . '&';
     }
     LogUserAction::model()->userAction($userId, $actionId, $params);
     $this->_return('MSG_SUCCESS');
 }