Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 225 Rev 226
Línea 2136... Línea 2136...
2136
                    if($userProgressMapper->update($userProgressCapsule)) {
2136
                    if($userProgressMapper->update($userProgressCapsule)) {
Línea 2137... Línea 2137...
2137
                        
2137
                        
2138
                        
2138
                        
2139
                        $userLog = new CompanyMicrolearningUserLog();
2139
                        $userLog = new CompanyMicrolearningUserLog();
2140
                        $userLog->activity      = CompanyMicrolearningUserLog::ACTIVITY_COMPLETED_CAPSULE;
2140
                        $userLog->activity      = CompanyMicrolearningUserLog::ACTIVITY_COMPLETED_CAPSULE;
2141
                        $userLog->user_id       = $currentUser->id;
2141
                        $userLog->user_id       = $userProgressSlide->user_id;
2142
                        $userLog->company_id    = $slide->company_id;
2142
                        $userLog->company_id    = $userProgressSlide->company_id;
2143
                        $userLog->topic_id      = $slide->topic_id;
2143
                        $userLog->topic_id      = $userProgressSlide->topic_id;
Línea 2144... Línea 2144...
2144
                        $userLog->capsule_id    = $slide->capsule_id;
2144
                        $userLog->capsule_id    = $userProgressSlide->capsule_id;
2145
                        $userLog->added_on      = $added_on;
2145
                        $userLog->added_on      = $added_on;
2146
                        
2146
                        
Línea 2223... Línea 2223...
2223
                    
2223
                    
2224
                    $userProgressTopic->completed = 1;
2224
                    $userProgressTopic->completed = 1;
Línea 2225... Línea 2225...
2225
                    $userProgressTopic->updated_on = $updated_on;
2225
                    $userProgressTopic->updated_on = $updated_on;
-
 
2226
                    
-
 
2227
                    if($userProgressMapper->update($userProgressTopic)) {
-
 
2228
                        
-
 
2229
                        $userLog = new CompanyMicrolearningUserLog();
-
 
2230
                        $userLog->activity      = CompanyMicrolearningUserLog::ACTIVITY_COMPLETED_TOPIC;
-
 
2231
                        $userLog->user_id       = $userProgressSlide->user_id;
-
 
2232
                        $userLog->company_id    = $userProgressSlide->company_id;
-
 
2233
                        $userLog->topic_id      = $userProgressSlide->topic_id;
-
 
2234
                        $userLog->added_on      = $added_on;
-
 
2235
                        
-
 
2236
                        if(!$userLogMapper->insert($userLog)) {
-
 
2237
                            return new JsonModel([
-
 
2238
                                'success' => false,
-
 
2239
                                'data' => $userProgressMapper->getError()
-
 
2240
                            ]);
2226
                    
2241
                        }
2227
                    if($userProgressMapper->update($userProgressTopic)) {
2242
                        
2228
                        return new JsonModel([
2243
                        return new JsonModel([
2229
                            'success' => true,
2244
                            'success' => true,
2230
                            'data' => 'LABEL_THE_USER_PROGRESS_FOR_THIS_TOPIC_HAS_BEEN_COMPLETED'
2245
                            'data' => 'LABEL_THE_USER_PROGRESS_FOR_THIS_TOPIC_HAS_BEEN_COMPLETED'