Proyectos de Subversion LeadersLinked - Services

Rev

Rev 224 | Rev 226 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 224 Rev 225
Línea 2132... Línea 2132...
2132
                    
2132
                    
2133
                    $userProgressCapsule->completed = 1;
2133
                    $userProgressCapsule->completed = 1;
Línea 2134... Línea 2134...
2134
                    $userProgressCapsule->updated_on = $updated_on;
2134
                    $userProgressCapsule->updated_on = $updated_on;
-
 
2135
                    
-
 
2136
                    if($userProgressMapper->update($userProgressCapsule)) {
-
 
2137
                        
-
 
2138
                        
-
 
2139
                        $userLog = new CompanyMicrolearningUserLog();
-
 
2140
                        $userLog->activity      = CompanyMicrolearningUserLog::ACTIVITY_COMPLETED_CAPSULE;
-
 
2141
                        $userLog->user_id       = $currentUser->id;
-
 
2142
                        $userLog->company_id    = $slide->company_id;
-
 
2143
                        $userLog->topic_id      = $slide->topic_id;
-
 
2144
                        $userLog->capsule_id    = $slide->capsule_id;
-
 
2145
                        $userLog->added_on      = $added_on;
-
 
2146
                        
-
 
2147
                        if(!$userLogMapper->insert($userLog)) {
-
 
2148
                            return new JsonModel([
-
 
2149
                                'success' => false,
-
 
2150
                                'data' => $userProgressMapper->getError()
-
 
2151
                            ]);
-
 
2152
                        }
2135
                    
2153
                        
2136
                    if($userProgressMapper->update($userProgressCapsule)) {
2154
                        
2137
                        return new JsonModel([
2155
                        return new JsonModel([
2138
                            'success' => true,
2156
                            'success' => true,
2139
                            'data' => 'LABEL_THE_USER_PROGRESS_FOR_THIS_CAPSULE_HAS_BEEN_COMPLETED'
2157
                            'data' => 'LABEL_THE_USER_PROGRESS_FOR_THIS_CAPSULE_HAS_BEEN_COMPLETED'