Browse Source

20221013 重新存取 utm 參數

LuluFJ.Ho 2 years ago
parent
commit
ed13315e57

+ 3
- 0
app/Http/Controllers/Api/SeminarSignUpController.php View File

@@ -242,6 +242,9 @@ class SeminarSignUpController extends ApiController
242 242
 
243 243
                 $cont = explode('=', $tmpArr[$i]);
244 244
                 $importArr[] = $cont[1];
245
+
246
+                $this->seminarSignUpSv->updateUTMData($id, $importArr);
247
+
245 248
             }
246 249
             return $importArr;
247 250
 

+ 16
- 0
app/Http/Services/Api/SeminarSignUpService.php View File

@@ -151,4 +151,20 @@ class SeminarSignUpService
151 151
 
152 152
     }
153 153
 
154
+    public function updateUTMData($id, $data) 
155
+    {
156
+        
157
+        $res = $this->signupDb
158
+            ->where('id', $id)
159
+            ->update([
160
+                'utm_source' => $data[0],
161
+                'utm_medium' => $data[1],
162
+                'utm_content' => $data[2],
163
+                'utm_term' => $data[3],
164
+                'utm_campaign' => $data[4],
165
+            ]);
166
+        
167
+        return $res;
168
+    }
169
+
154 170
 }