曹鹤洋 2 роки тому
батько
коміт
556978d4d9
1 змінених файлів з 14 додано та 14 видалено
  1. 14 14
      application/api/controller/Index.php

+ 14 - 14
application/api/controller/Index.php

@@ -65,7 +65,7 @@ class Index extends Api
             //开启事务
             db()->startTrans();
             try {
-                //连接数据库, 将数据插入主表vocs_gather_txt_gc取得pid
+                //连接数据库, 将数据插入主表gather_txt_gc取得pid
                 $pid = db()->name('gather_txt_gc')->insertGetId($res);
 
                 $row = [];
@@ -95,7 +95,7 @@ class Index extends Api
                     $j++;
                 }
 
-                //将检测数据插入子表vocs_gather_txt_check_gc
+                //将检测数据插入子表gather_txt_check_gc
                 db()->name('gather_txt_check_gc')->insertAll($row);
 
                 //提交事务
@@ -143,7 +143,7 @@ class Index extends Api
             //开启事务
             db()->startTrans();
             try {
-                //连接数据库, 将数据插入主表vocs_gather_txt_gc取得pid
+                //连接数据库, 将数据插入主表gather_txt_gc取得pid
                 $pid = db()->name('gather_txt_gcms')->insertGetId($res);
 
                 $row = [];
@@ -174,7 +174,7 @@ class Index extends Api
                     }
                     $j++;
                 }
-                //将检测数据插入子表vocs_gather_txt_check_gc
+                //将检测数据插入子表gather_txt_check_gc
                 $id = db()->name('gather_txt_check_gcms')->insertAll($row);
                 //提交事务
                 db()->commit();
@@ -225,17 +225,17 @@ class Index extends Api
                 'create'                    => $time,
             ];
 
-            $id = db()->name('vocs_gather_txt_gc')->field('id')->where('data_txt_name',$res['data_txt_name'])->find();
+            $id = db()->name('gather_txt_gc')->field('id')->where('data_txt_name',$res['data_txt_name'])->find();
 
             if($id){
                 //开启事务
                 db()->startTrans();
                 try {
                     //根据id修改主表数据
-                    $bool = db()->name('vocs_gather_txt_gc')->where('id',$id['id'])->update($res);
+                    $bool = db()->name('gather_txt_gc')->where('id',$id['id'])->update($res);
                     if($bool){
                         //根据pid删除子表数据
-                        db()->name('vocs_gather_txt_check_gc')->where('pid',$id['id'])->delete();
+                        db()->name('gather_txt_check_gc')->where('pid',$id['id'])->delete();
 
                         //根据id新增子表数据
                         $row = [];
@@ -265,8 +265,8 @@ class Index extends Api
                             $j++;
                         }
 
-                        //将检测数据插入子表vocs_gather_txt_check_gc
-                        db()->name('vocs_gather_txt_check_gc')->insertAll($row);
+                        //将检测数据插入子表gather_txt_check_gc
+                        db()->name('gather_txt_check_gc')->insertAll($row);
                         //提交事务
                         db()->commit();
                         return json_encode(['code'=>'0','msg'=>'修改成功','time'=>$time,'data'=>[$res,$row]]);
@@ -310,16 +310,16 @@ class Index extends Api
                 'create'                    => $time,
             ];
 
-            $id = db()->name('vocs_gather_txt_gcms')->field('id')->where('data_txt_name',$res['data_txt_name'])->find();
+            $id = db()->name('gather_txt_gcms')->field('id')->where('data_txt_name',$res['data_txt_name'])->find();
             if($id){
                 //开启事务
                 db()->startTrans();
                 try {
                     //根据id修改主表数据
-                    $bool = db()->name('vocs_gather_txt_gcms')->where('id',$id['id'])->update($res);
+                    $bool = db()->name('gather_txt_gcms')->where('id',$id['id'])->update($res);
                     if($bool) {
                         //根据pid删除子表数据
-                        db()->name('vocs_gather_txt_check_gcms')->where('pid', $id['id'])->delete();
+                        db()->name('gather_txt_check_gcms')->where('pid', $id['id'])->delete();
 
                         //根据id新增子表数据
                         $row = [];
@@ -350,8 +350,8 @@ class Index extends Api
                             }
                             $j++;
                         }
-                        //将检测数据插入子表vocs_gather_txt_check_gc
-                        db()->name('vocs_gather_txt_check_gcms')->insertAll($row);
+                        //将检测数据插入子表gather_txt_check_gc
+                        db()->name('gather_txt_check_gcms')->insertAll($row);
                         //提交事务
                         db()->commit();
                         return json_encode(['code'=>'0','msg'=>'修改成功','time'=>$time,'data'=>[$res,$row]]);