function actionHiddenPlay()
 {
     header('Content-type: application/json');
     if (!Yii::app()->request->isPostRequest) {
         IjoyPlusServiceUtils::exportServiceError(Constants::METHOD_NOT_SUPPORT);
         return;
     }
     if (!IjoyPlusServiceUtils::validateAPPKey()) {
         IjoyPlusServiceUtils::exportServiceError(Constants::APP_KEY_INVALID);
         return;
     }
     $prod_id = Yii::app()->request->getParam("prod_id");
     if (!isset($prod_id) || is_null($prod_id)) {
         IjoyPlusServiceUtils::exportServiceError(Constants::PARAM_IS_INVALID);
         return;
     }
     if (IjoyPlusServiceUtils::validateUserID()) {
         IjoyPlusServiceUtils::exportServiceError(Constants::USER_ID_INVALID);
         return;
     }
     try {
         $userid = Yii::app()->user->id;
         $history = PlayHistory::model()->getHisotryByProd($userid, $prod_id);
         if ($history !== null) {
             $history->status = Constants::OBJECT_DELETE;
             $history->save();
         }
         IjoyPlusServiceUtils::exportServiceError(Constants::SUCC);
     } catch (Exception $e) {
         IjoyPlusServiceUtils::exportServiceError(Constants::SYSTEM_ERROR);
     }
 }
Пример #2
0
 function actionClearPlayHistory()
 {
     header('Content-type: application/json');
     if (!Yii::app()->request->isPostRequest) {
         IjoyPlusServiceUtils::exportServiceError(Constants::METHOD_NOT_SUPPORT);
         return;
     }
     if (!IjoyPlusServiceUtils::validateAPPKey()) {
         IjoyPlusServiceUtils::exportServiceError(Constants::APP_KEY_INVALID);
         return;
     }
     if (IjoyPlusServiceUtils::validateUserID()) {
         IjoyPlusServiceUtils::exportServiceError(Constants::USER_ID_INVALID);
         return;
     }
     try {
         $userid = Yii::app()->user->id;
         $history_id = Yii::app()->request->getParam("history_id");
         if (!isset($history_id) || is_null($history_id)) {
             IjoyPlusServiceUtils::exportServiceError(Constants::PARAM_IS_INVALID);
             return;
         }
         PlayHistory::model()->delUserSingleHisotry($userid, $history_id);
         IjoyPlusServiceUtils::exportServiceError(Constants::SUCC);
     } catch (Exception $e) {
         IjoyPlusServiceUtils::exportServiceError(Constants::SYSTEM_ERROR);
     }
 }