cqpCow 1 năm trước cách đây
mục cha
commit
034b6c3b2a
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      app/Service/FollowUpRecordService.php

+ 3 - 3
app/Service/FollowUpRecordService.php

@@ -50,7 +50,7 @@ class FollowUpRecordService extends Service
                 FollowUpRecordFile::insert($insert);
             }
 
-            DB::rollBack();
+            DB::commit();
         }catch (\Exception $exception){
             DB::rollBack();
             return [false,$exception->getMessage()];
@@ -84,7 +84,7 @@ class FollowUpRecordService extends Service
                 $insert = [];
                 foreach ($data['file'] as $value){
                     $insert[] = [
-                        'follow_up_record_id' => $data['id'],
+                        'follow_up_record_id' => $model->id,
                         'file' => $value['url'],
                         'name' => $value['name'],
                         'type' => FollowUpRecordFile::type_one,
@@ -94,7 +94,7 @@ class FollowUpRecordService extends Service
                 FollowUpRecordFile::insert($insert);
             }
 
-            DB::rollBack();
+            DB::commit();
         }catch (\Exception $exception){
             DB::rollBack();
             return [false,$exception->getMessage()];