DataObjects/Core_person.php
authorbenny <benny@roojs.com>
Thu, 2 Aug 2018 08:27:55 +0000 (16:27 +0800)
committerbenny <benny@roojs.com>
Thu, 2 Aug 2018 08:27:55 +0000 (16:27 +0800)
DataObjects/Core_person.php

index 7e5ef08..284f1f0 100644 (file)
@@ -1401,10 +1401,15 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         }
         
         if(!empty($q['membership_list'])){
+            $group_id_arr = explode(",", $q['membership_list']);
+            
+            var_dump($group_id_arr); exit;
             
             // insert data into core_person_member...
             //PDO_DataObject::Factory('coremytable_group_member')->set([ 'group_id' => 'test', 'user_id' => "{$this->tableName()}.id"])->insert();
-            
+            foreach($group_id_arr as $gid){
+                PDO_DataObject::Factory('coremytable_group_member')->set([ 'group_id' => $gid, 'user_id' => $this->tableName().id])->insert();
+            }
         }
     }