| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | 
							- <?php
 - 
 - namespace App\Http\Services\Api;
 - 
 - use App\Models\SignupData;
 - use App\Models\TrackData;
 - 
 - use DB;
 - use GuzzleHttp\Client;
 - 
 - class SeminarSignUpService
 - {
 -     protected $signupDb;
 -     protected $trackDataDb;
 -     
 -     public function __construct()
 -     {
 -         $this->signupDb = new SignupData();
 -         $this->trackDataDb = new TrackData();
 -         
 -     }
 -     
 -     public function insertData(
 -         $firstName, $lastName, $companyName, $companyEmail, $backupEmail, $phoneNumber, $country, $trackNo, 
 -         $registeredSession, $lunchOptions, $typeOfIndustry, $typeOfJob, $jobTitle, $trackOfInterest, $areaOfInterest, $howToKnowAboutTheEvent, 
 -         $consentAcceptEmail, $consentPrivacyPolicy)
 -     {
 -         
 -         $this->signupDb
 -             ->insert([
 -                 'firstName'     => $firstName,
 -                 'lastName'      => $lastName,
 -                 'companyName'   => $companyName,
 -                 'companyEmail'  => $companyEmail,
 -                 'backupEmail'   => $backupEmail,
 -                 'phoneNumber'   => $phoneNumber,
 -                 'country'       => $country,
 -                 'trackNo'       => $trackNo,
 -                 'registeredSession' => $registeredSession,
 -                 'lunchOptions'      => $lunchOptions,
 -                 'typeOfIndustry'    => $typeOfIndustry,
 -                 'typeOfJob'     => $typeOfJob,
 -                 'jobTitle'      => $jobTitle,
 -                 'trackOfInterest'   => $trackOfInterest,
 -                 'areaOfInterest'    => $areaOfInterest,
 -                 'howToKnowAboutTheEvent'    => $howToKnowAboutTheEvent,
 -                 'consentAcceptEmail'    => $consentAcceptEmail,
 -                 'consentPrivacyPolicy'    => $consentPrivacyPolicy,
 -                 'createDate'    => date("Y-m-d H:i:s"),
 -             ]);
 -         
 -     }
 -     
 -     public function overLimitOrNot($trackNo)
 -     {
 - 
 -         $nowCount = $this->signupDb
 -             ->where('trackNo', '=', $trackNo)
 -             ->count();
 -         
 -         $limit = $this->trackDataDb
 -             ->select('trackLimit')
 -             ->where('trackNo', '=', $trackNo)
 -             ->first();
 -         
 -         if ($limit->trackLimit>$nowCount) {
 -             return true;
 -         } else {
 -             return false;
 -         }
 -     }
 -     
 -     public function getData()
 -     {
 -         $res = $this->trackDataDb
 -         ->select([
 -             '*'
 -         ])
 -         ->get();
 - 
 -         // 整理返回值並返回
 -         return $res;
 - 
 -     }
 - 
 - }
 
 
  |