/**
  * check the promocode in the offline to get the score
  */
 public function actionCheck()
 {
     $params = $this->getQuery();
     if (empty($params['code']) || empty($params['memberId'])) {
         throw new BadRequestHttpException('missing params');
     }
     if (empty($params['exchangeTime'])) {
         $params['exchangeTime'] = time();
     } else {
         $params['exchangeTime'] = TimeUtil::ms2sTime($params['exchangeTime']);
     }
     $exchangeTime = new MongoDate($params['exchangeTime']);
     $member = Member::findByPk($params['memberId']);
     if (empty($member)) {
         throw new InvalidParameterException(Yii::t('member', 'no_member_find'));
     }
     if ($member->isDisabled) {
         throw new InvalidParameterException(Yii::t('member', 'member_invalid_not_exchange'));
     }
     $codes = explode(',', $params['code']);
     $codes = array_unique($codes);
     foreach ($codes as $key => $code) {
         $codes[$key] = (string) strtoupper(trim($code));
     }
     $accountId = $this->getAccountId();
     $datas = PromotionCode::checkCodeStatus($codes, $accountId, $member, $exchangeTime, $params);
     //sort the code
     $newCode = [];
     $totalScore = 0;
     foreach ($codes as $code) {
         foreach ($datas as $key => $data) {
             if ($data['code'] == $code) {
                 $newCode[] = $data;
             }
         }
     }
     return ['data' => $newCode];
 }