예제 #1
0
 public function actionSendSmsToWinners($id)
 {
     if (empty($id)) {
         throw new BadRequestHttpException('param is missing.(LuckyDrawRecordId)');
     }
     $accountId = $this->getAccountId();
     $operator = $this->getUser()->email;
     $condition = ['accountId' => $accountId, 'drawRecordId' => new \MongoId($id)];
     $result = BulkSmsUtil::createSmsJob($condition, $operator, 'cny_winners');
     if (!empty($result)) {
         $remark = ['sentSMS' => true, 'smsRecordId' => new \MongoId($result['smsRecordId'])];
         LuckyDrawRecord::addRemark(new \MongoId($id), $remark);
     }
     Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     return $result;
 }