|  | @@ -61,6 +61,11 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 61 | 61 |          $consentAcceptEmail = $request->input('consentAcceptEmail', '');
 | 
	
		
			
			| 62 | 62 |          $consentPrivacyPolicy = $request->input('consentPrivacyPolicy', '');
 | 
	
		
			
			| 63 | 63 |          $media = $request->input('media', '');
 | 
	
		
			
			|  | 64 | +        $utm_source = $request->input('utm_source', '');
 | 
	
		
			
			|  | 65 | +        $utm_medium = $request->input('utm_medium', '');
 | 
	
		
			
			|  | 66 | +        $utm_content = $request->input('utm_content', '');
 | 
	
		
			
			|  | 67 | +        $utm_term = $request->input('utm_term', '');
 | 
	
		
			
			|  | 68 | +        $utm_campaign = $request->input('utm_campaign', '');
 | 
	
		
			
			| 64 | 69 |          
 | 
	
		
			
			| 65 | 70 |          $overOrNot = $this->seminarSignUpSv->overLimitOrNot($trackNo);          // true: 可報名 / false: 已額滿
 | 
	
		
			
			| 66 | 71 |          $duplicatedOrNot = $this->seminarSignUpSv->duplicatedOrNot($trackNo, $companyEmail, $phoneNumber);   // true: 可報名 / false: 已重複
 | 
	
	
		
			
			|  | @@ -87,6 +92,11 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 87 | 92 |                  $consentAcceptEmail,
 | 
	
		
			
			| 88 | 93 |                  $consentPrivacyPolicy,
 | 
	
		
			
			| 89 | 94 |                  $media,
 | 
	
		
			
			|  | 95 | +                $utm_source,
 | 
	
		
			
			|  | 96 | +                $utm_medium,
 | 
	
		
			
			|  | 97 | +                $utm_content,
 | 
	
		
			
			|  | 98 | +                $utm_term,
 | 
	
		
			
			|  | 99 | +                $utm_campaign,
 | 
	
		
			
			| 90 | 100 |              );
 | 
	
		
			
			| 91 | 101 |              $res = '報名成功';
 | 
	
		
			
			| 92 | 102 |  
 | 
	
	
		
			
			|  | @@ -210,6 +220,87 @@ class SeminarSignUpController extends ApiController
 | 
	
		
			
			| 210 | 220 |  
 | 
	
		
			
			| 211 | 221 |      }
 | 
	
		
			
			| 212 | 222 |  
 | 
	
		
			
			|  | 223 | +    // list 
 | 
	
		
			
			|  | 224 | +    public function restoreUTMData()
 | 
	
		
			
			|  | 225 | +    {
 | 
	
		
			
			|  | 226 | +        
 | 
	
		
			
			|  | 227 | +        $list = $this->seminarSignUpSv->getReMailData();
 | 
	
		
			
			|  | 228 | +        
 | 
	
		
			
			|  | 229 | +        $returnData = array();
 | 
	
		
			
			|  | 230 | +        for ($i = 0; $i < count($list); $i++) {
 | 
	
		
			
			|  | 231 | +
 | 
	
		
			
			|  | 232 | +            // try{
 | 
	
		
			
			|  | 233 | +                // \Log::info($this->safeDecrypt($list[$i]["firstName"], 'arm'));
 | 
	
		
			
			|  | 234 | +                
 | 
	
		
			
			|  | 235 | +                // $data[] = array(
 | 
	
		
			
			|  | 236 | +                    //一般資料
 | 
	
		
			
			|  | 237 | +                    $id = $list[$i]["id"];
 | 
	
		
			
			|  | 238 | +                    
 | 
	
		
			
			|  | 239 | +                    $firstName_orig = $this->safeDecrypt($list[$i]["firstName"], 'arm');
 | 
	
		
			
			|  | 240 | +                    $lastName_orig = $this->safeDecrypt($list[$i]["lastName"], 'arm');
 | 
	
		
			
			|  | 241 | +                    $companyName_orig = $this->safeDecrypt($list[$i]["companyName"], 'arm');
 | 
	
		
			
			|  | 242 | +                    $companyEmail_orig = $this->safeDecrypt($list[$i]["companyEmail"], 'arm');
 | 
	
		
			
			|  | 243 | +                    
 | 
	
		
			
			|  | 244 | +                    if (!is_null($list[$i]["backupEmail"])) {
 | 
	
		
			
			|  | 245 | +        
 | 
	
		
			
			|  | 246 | +                        $backupEmail_orig = $this->safeDecrypt($list[$i]["backupEmail"], 'arm');
 | 
	
		
			
			|  | 247 | +                    } else {
 | 
	
		
			
			|  | 248 | +                        $backupEmail_orig = '';
 | 
	
		
			
			|  | 249 | +                    }
 | 
	
		
			
			|  | 250 | +
 | 
	
		
			
			|  | 251 | +                    $phoneNumber_orig = $this->safeDecrypt($list[$i]["phoneNumber"], 'arm');
 | 
	
		
			
			|  | 252 | +
 | 
	
		
			
			|  | 253 | +                    $country = $list[$i]["country"];
 | 
	
		
			
			|  | 254 | +                    
 | 
	
		
			
			|  | 255 | +                    $trackNo = $list[$i]["trackNo"];
 | 
	
		
			
			|  | 256 | +                    $lang = substr($trackNo, 0, 2);
 | 
	
		
			
			|  | 257 | +
 | 
	
		
			
			|  | 258 | +                    $registeredSession = $list[$i]["registeredSession"];
 | 
	
		
			
			|  | 259 | +                    $lunchOptions = $list[$i]["lunchOptions"];
 | 
	
		
			
			|  | 260 | +                    $typeOfIndustry = $list[$i]["typeOfIndustry"];
 | 
	
		
			
			|  | 261 | +                    $typeOfJob = $list[$i]["typeOfJob"];
 | 
	
		
			
			|  | 262 | +                    $jobTitle = $list[$i]["jobTitle"];
 | 
	
		
			
			|  | 263 | +                    $trackOfInterest = $list[$i]["trackOfInterest"];
 | 
	
		
			
			|  | 264 | +
 | 
	
		
			
			|  | 265 | +                // );
 | 
	
		
			
			|  | 266 | +
 | 
	
		
			
			|  | 267 | +                $res = [
 | 
	
		
			
			|  | 268 | +                    'id'      => $id,
 | 
	
		
			
			|  | 269 | +                    'value'    => $id.' / '.$firstName_orig.' / '.$lastName_orig.' / '.$companyName_orig.' / '.$companyEmail_orig.' / '.
 | 
	
		
			
			|  | 270 | +                                $backupEmail_orig.' / '.$phoneNumber_orig.' / '.$country.' / '.$trackNo.' / '.$lang.' / '.$registeredSession.' / '.
 | 
	
		
			
			|  | 271 | +                                $lunchOptions.' / '.$typeOfIndustry.' / '.$typeOfJob.' / '.$jobTitle.' / '.$trackOfInterest,
 | 
	
		
			
			|  | 272 | +                    'message' => 'succ',
 | 
	
		
			
			|  | 273 | +                ];
 | 
	
		
			
			|  | 274 | +                \Log::info($id.': '.print_r($res, true));
 | 
	
		
			
			|  | 275 | +                $returnData[] = $res;
 | 
	
		
			
			|  | 276 | +            // } catch (\Throwable $exception) {
 | 
	
		
			
			|  | 277 | +
 | 
	
		
			
			|  | 278 | +            //     $message = [
 | 
	
		
			
			|  | 279 | +            //         'msg'  => $exception->getMessage(),
 | 
	
		
			
			|  | 280 | +            //         'line' => $exception->getLine(),
 | 
	
		
			
			|  | 281 | +            //         'file' => $exception->getFile()
 | 
	
		
			
			|  | 282 | +            //     ];
 | 
	
		
			
			|  | 283 | +
 | 
	
		
			
			|  | 284 | +            //     // 返回
 | 
	
		
			
			|  | 285 | +            //     $res = [
 | 
	
		
			
			|  | 286 | +            //         'id'      => $id,
 | 
	
		
			
			|  | 287 | +            //         'value'    => $id.' / '.$firstName_orig.' / '.$lastName_orig.' / '.$companyName_orig.' / '.$companyEmail_orig.' / '.
 | 
	
		
			
			|  | 288 | +            //                     $backupEmail_orig.' / '.$phoneNumber_orig.' / '.$country.' / '.$trackNo.' / '.$lang.' / '.$registeredSession.' / '.
 | 
	
		
			
			|  | 289 | +            //                     $lunchOptions.' / '.$typeOfIndustry.' / '.$typeOfJob.' / '.$jobTitle.' / '.$trackOfInterest,
 | 
	
		
			
			|  | 290 | +            //         'message' => $message,
 | 
	
		
			
			|  | 291 | +            //     ];
 | 
	
		
			
			|  | 292 | +            //     $returnData[] = $res;
 | 
	
		
			
			|  | 293 | +
 | 
	
		
			
			|  | 294 | +            //     $log = json_encode($res, JSON_UNESCAPED_UNICODE);
 | 
	
		
			
			|  | 295 | +            //     \Log::info(print_r($log, true));
 | 
	
		
			
			|  | 296 | +                
 | 
	
		
			
			|  | 297 | +            // }
 | 
	
		
			
			|  | 298 | +        }
 | 
	
		
			
			|  | 299 | +        
 | 
	
		
			
			|  | 300 | +        return $returnData;
 | 
	
		
			
			|  | 301 | +
 | 
	
		
			
			|  | 302 | +    }
 | 
	
		
			
			|  | 303 | +
 | 
	
		
			
			| 213 | 304 |      public function getData()
 | 
	
		
			
			| 214 | 305 |      {
 | 
	
		
			
			| 215 | 306 |          $list = $this->seminarSignUpSv->getData();
 |