|
@@ -123,121 +123,91 @@ class SeminarSignUpController extends ApiController
|
123
|
123
|
|
124
|
124
|
$list = $this->seminarSignUpSv->getReMailData();
|
125
|
125
|
|
126
|
|
-
|
|
126
|
+ $returnData = array();
|
127
|
127
|
for ($i = 0; $i < count($list); $i++) {
|
128
|
128
|
|
129
|
|
-
|
130
|
|
- \Log::info($this->safeDecrypt($list[$i]["firstName"], 'arm'));
|
131
|
|
-
|
132
|
|
- $data[] = array(
|
133
|
|
- //一般資料
|
134
|
|
- $list[$i]["id"],
|
135
|
|
- $this->safeDecrypt($list[$i]["firstName"], 'arm'),
|
136
|
|
- $this->safeDecrypt($list[$i]["lastName"], 'arm'),
|
137
|
|
- $this->safeDecrypt($list[$i]["companyName"], 'arm'),
|
138
|
|
- $list[$i]["country"],
|
139
|
|
- $list[$i]["trackNo"],
|
140
|
|
- $list[$i]["registeredSession"],
|
141
|
|
- $list[$i]["lunchOptions"],
|
142
|
|
- $list[$i]["createDate"],
|
143
|
|
- );
|
144
|
|
- }
|
|
129
|
+ try{
|
|
130
|
+ \Log::info($this->safeDecrypt($list[$i]["firstName"], 'arm'));
|
|
131
|
+
|
|
132
|
+ // $data[] = array(
|
|
133
|
+ //一般資料
|
|
134
|
+ $id = $list[$i]["id"];
|
|
135
|
+
|
|
136
|
+ $firstName_orig = $this->safeDecrypt($list[$i]["firstName"], 'arm');
|
|
137
|
+ $lastName_orig = $this->safeDecrypt($list[$i]["lastName"], 'arm');
|
|
138
|
+ $companyName_orig = $this->safeDecrypt($list[$i]["companyName"], 'arm');
|
|
139
|
+ $companyEmail_orig = $this->safeDecrypt($list[$i]["companyEmail"], 'arm');
|
|
140
|
+
|
|
141
|
+ if (!is_null($list[$i]["backupEmail"])) {
|
145
|
142
|
|
146
|
|
- return $data;
|
147
|
|
-
|
148
|
|
- $trackNo = $request->input('trackNo', '');
|
149
|
|
- $lang = substr($trackNo, 0, 2);
|
150
|
|
-
|
151
|
|
- $firstName_orig = $request->input('firstName', '');
|
152
|
|
- $firstName = $this->safeEncrypt($firstName_orig, 'arm');
|
153
|
|
-
|
154
|
|
- $lastName_orig = $request->input('lastName', '');
|
155
|
|
- $lastName = $this->safeEncrypt($lastName_orig, 'arm');
|
156
|
|
-
|
157
|
|
- $companyName_orig = $request->input('companyName', '');
|
158
|
|
- $companyName = $this->safeEncrypt($companyName_orig, 'arm');
|
159
|
|
-
|
160
|
|
- $companyEmail_orig = $request->input('companyEmail', '');
|
161
|
|
- $companyEmail = $this->safeEncrypt($companyEmail_orig, 'arm');
|
162
|
|
-
|
163
|
|
- $backupEmail = $request->input('backupEmail', '');
|
164
|
|
- if (!is_null($backupEmail)) {
|
165
|
|
-
|
166
|
|
- $backupEmail_orig = $request->input('backupEmail', '');
|
167
|
|
- $backupEmail = $this->safeEncrypt($backupEmail_orig, 'arm');
|
168
|
|
- } else {
|
169
|
|
- $backupEmail_orig = '';
|
170
|
|
- }
|
171
|
|
-
|
172
|
|
- $phoneNumber_orig = $request->input('phoneNumber', '');
|
173
|
|
- $phoneNumber = $this->safeEncrypt($phoneNumber_orig, 'arm');
|
174
|
|
-
|
175
|
|
- $country = $request->input('country', '');
|
176
|
|
- $registeredSession = $request->input('registeredSession', '');
|
177
|
|
- $lunchOptions = $request->input('lunchOptions', '');
|
178
|
|
- $typeOfIndustry = $request->input('typeOfIndustry', '');
|
179
|
|
- $typeOfJob = $request->input('typeOfJob', '');
|
180
|
|
- $jobTitle = $request->input('jobTitle', '');
|
181
|
|
- $trackOfInterest = $request->input('trackOfInterest', '');
|
182
|
|
- $areaOfInterest = $request->input('areaOfInterest', '');
|
183
|
|
- $howToKnowAboutTheEvent = $request->input('howToKnowAboutTheEvent', '');
|
184
|
|
- $consentAcceptEmail = $request->input('consentAcceptEmail', '');
|
185
|
|
- $consentPrivacyPolicy = $request->input('consentPrivacyPolicy', '');
|
186
|
|
- $media = $request->input('media', '');
|
187
|
|
-
|
188
|
|
- $overOrNot = $this->seminarSignUpSv->overLimitOrNot($trackNo); // true: 可報名 / false: 已額滿
|
189
|
|
- $duplicatedOrNot = $this->seminarSignUpSv->duplicatedOrNot($trackNo, $companyEmail, $phoneNumber); // true: 可報名 / false: 已重複
|
190
|
|
-
|
191
|
|
- if ($overOrNot&&$duplicatedOrNot) {
|
192
|
|
-
|
193
|
|
- $this->seminarSignUpSv->insertData(
|
194
|
|
- $firstName,
|
195
|
|
- $lastName,
|
196
|
|
- $companyName,
|
197
|
|
- $companyEmail,
|
198
|
|
- $backupEmail,
|
199
|
|
- $phoneNumber,
|
200
|
|
- $country,
|
201
|
|
- $trackNo,
|
202
|
|
- $registeredSession,
|
203
|
|
- $lunchOptions,
|
204
|
|
- $typeOfIndustry,
|
205
|
|
- $typeOfJob,
|
206
|
|
- $jobTitle,
|
207
|
|
- $trackOfInterest,
|
208
|
|
- $areaOfInterest,
|
209
|
|
- $howToKnowAboutTheEvent,
|
210
|
|
- $consentAcceptEmail,
|
211
|
|
- $consentPrivacyPolicy,
|
212
|
|
- $media,
|
213
|
|
- );
|
214
|
|
- $res = '報名成功';
|
215
|
|
-
|
216
|
|
- if ($lang=='TP'||$lang=='HS') {
|
217
|
|
- $this->mailToUser_TW($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig,
|
218
|
|
- $phoneNumber_orig, $country, $registeredSession, $lunchOptions, $typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
|
219
|
|
- } elseif ($lang=='JP') {
|
220
|
|
- $this->mailToUser_JP($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig,
|
221
|
|
- $phoneNumber_orig, $country, /*$registeredSession, $lunchOptions, */$typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
|
222
|
|
- } elseif ($lang=='KR') {
|
223
|
|
- $this->mailToUser_KR($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig,
|
224
|
|
- $phoneNumber_orig, $country, /*$registeredSession, $lunchOptions, */$typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
|
225
|
|
- } else {
|
226
|
|
- $this->mailToUser_EN($firstName_orig, $companyEmail_orig, $backupEmail_orig);
|
|
143
|
+ $backupEmail_orig = $this->safeDecrypt($list[$i]["backupEmail"], 'arm');
|
|
144
|
+ } else {
|
|
145
|
+ $backupEmail_orig = '';
|
|
146
|
+ }
|
|
147
|
+
|
|
148
|
+ $phoneNumber_orig = $this->safeDecrypt($list[$i]["phoneNumber"], 'arm');
|
|
149
|
+
|
|
150
|
+ $country = $list[$i]["country"];
|
|
151
|
+
|
|
152
|
+ $trackNo = $list[$i]["trackNo"];
|
|
153
|
+ $lang = substr($trackNo, 0, 2);
|
|
154
|
+
|
|
155
|
+ $registeredSession = $list[$i]["registeredSession"];
|
|
156
|
+ $lunchOptions = $list[$i]["lunchOptions"];
|
|
157
|
+ $typeOfIndustry = $list[$i]["typeOfIndustry"];
|
|
158
|
+ $typeOfJob = $list[$i]["typeOfJob"];
|
|
159
|
+ $jobTitle = $list[$i]["jobTitle"];
|
|
160
|
+ $trackOfInterest = $list[$i]["trackOfInterest"];
|
|
161
|
+
|
|
162
|
+ // if ($lang=='TP'||$lang=='HS') {
|
|
163
|
+ // $this->mailToUser_TW($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig,
|
|
164
|
+ // $phoneNumber_orig, $country, $registeredSession, $lunchOptions, $typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
|
|
165
|
+ // } elseif ($lang=='JP') {
|
|
166
|
+ // $this->mailToUser_JP($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig,
|
|
167
|
+ // $phoneNumber_orig, $country, /*$registeredSession, $lunchOptions, */$typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
|
|
168
|
+ // } elseif ($lang=='KR') {
|
|
169
|
+ // $this->mailToUser_KR($firstName_orig, $lastName_orig, $companyName_orig, $companyEmail_orig, $backupEmail_orig,
|
|
170
|
+ // $phoneNumber_orig, $country, /*$registeredSession, $lunchOptions, */$typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest);
|
|
171
|
+ // } else {
|
|
172
|
+ // $this->mailToUser_EN($firstName_orig, $companyEmail_orig, $backupEmail_orig);
|
|
173
|
+ // }
|
|
174
|
+ // );
|
|
175
|
+
|
|
176
|
+ $res = [
|
|
177
|
+ 'id' => $id,
|
|
178
|
+ 'value' => $id.' / '.$firstName_orig.' / '.$lastName_orig.' / '.$companyName_orig.' / '.$companyEmail_orig.' / '.
|
|
179
|
+ $backupEmail_orig.' / '.$phoneNumber_orig.' / '.$country.' / '.$trackNo.' / '.$lang.' / '.$registeredSession.' / '.
|
|
180
|
+ $lunchOptions.' / '.$typeOfIndustry.' / '.$typeOfJob.' / '.$jobTitle.' / '.$trackOfInterest,
|
|
181
|
+ 'message' => $message,
|
|
182
|
+ ];
|
|
183
|
+ \Log::info($id.': '.print_r($res, true));
|
|
184
|
+ $returnData[] = $res;
|
|
185
|
+ } catch (\Throwable $exception) {
|
|
186
|
+
|
|
187
|
+ $message = [
|
|
188
|
+ 'msg' => $exception->getMessage(),
|
|
189
|
+ 'line' => $exception->getLine(),
|
|
190
|
+ 'file' => $exception->getFile()
|
|
191
|
+ ];
|
|
192
|
+
|
|
193
|
+ // 返回
|
|
194
|
+ $res = [
|
|
195
|
+ 'id' => $id,
|
|
196
|
+ 'value' => $id.' / '.$firstName_orig.' / '.$lastName_orig.' / '.$companyName_orig.' / '.$companyEmail_orig.' / '.
|
|
197
|
+ $backupEmail_orig.' / '.$phoneNumber_orig.' / '.$country.' / '.$trackNo.' / '.$lang.' / '.$registeredSession.' / '.
|
|
198
|
+ $lunchOptions.' / '.$typeOfIndustry.' / '.$typeOfJob.' / '.$jobTitle.' / '.$trackOfInterest,
|
|
199
|
+ 'message' => $message,
|
|
200
|
+ ];
|
|
201
|
+ $returnData[] = $res;
|
|
202
|
+
|
|
203
|
+ $log = json_encode($res, JSON_UNESCAPED_UNICODE);
|
|
204
|
+ \Log::info(print_r($log, true));
|
|
205
|
+
|
227
|
206
|
}
|
228
|
|
-
|
229
|
|
- } elseif (!$overOrNot) {
|
230
|
|
-
|
231
|
|
- $res = '已達報名上限';
|
232
|
|
- } elseif (!$duplicatedOrNot) {
|
233
|
|
-
|
234
|
|
- $res = '已重複報名';
|
235
|
207
|
}
|
236
|
|
- $data = [
|
237
|
|
- 'res' => $res,
|
238
|
|
- ];
|
239
|
208
|
|
240
|
|
- return $this->apiResponse($data);
|
|
209
|
+ return $returnData;
|
|
210
|
+
|
241
|
211
|
}
|
242
|
212
|
|
243
|
213
|
public function getData()
|