فهرست منبع

txt上传接口优化

曹鹤洋 2 سال پیش
والد
کامیت
734e5f8e4a
1فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 6 6
      application/api/controller/Index.php

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

@@ -55,7 +55,7 @@ class Index extends Api
             ];
             ];
 
 
             //查询记录是否存在
             //查询记录是否存在
-            $bool = db()->table('gather_txt_gc')->where('remak',$res['remak'])->find();
+            $bool = db()->name('gather_txt_gc')->where('remak',$res['remak'])->find();
             if($bool){
             if($bool){
                 return '已存在';
                 return '已存在';
             }
             }
@@ -63,7 +63,7 @@ class Index extends Api
             db()->startTrans();
             db()->startTrans();
             try {
             try {
                 //连接数据库, 将数据插入主表vocs_gather_txt_gc取得pid
                 //连接数据库, 将数据插入主表vocs_gather_txt_gc取得pid
-                $pid = db()->table('gather_txt_gc')->insertGetId($res);
+                $pid = db()->name('gather_txt_gc')->insertGetId($res);
 
 
                 $row = [];
                 $row = [];
                 $j = 0;
                 $j = 0;
@@ -94,7 +94,7 @@ class Index extends Api
                 }
                 }
 
 
                 //将检测数据插入子表vocs_gather_txt_check_gc
                 //将检测数据插入子表vocs_gather_txt_check_gc
-                db()->table('gather_txt_check_gc')->insertAll($row);
+                db()->name('gather_txt_check_gc')->insertAll($row);
 
 
                 //提交事务
                 //提交事务
                 db()->commit();
                 db()->commit();
@@ -134,7 +134,7 @@ class Index extends Api
             ];
             ];
 
 
             //查询记录是否存在
             //查询记录是否存在
-            $bool = db()->table('gather_txt_gcms')->where('gather_time',$res['gather_time'])->find();
+            $bool = db()->name('gather_txt_gcms')->where('gather_time',$res['gather_time'])->find();
             if($bool){
             if($bool){
                 return '已存在';
                 return '已存在';
             }
             }
@@ -142,7 +142,7 @@ class Index extends Api
             db()->startTrans();
             db()->startTrans();
             try {
             try {
                 //连接数据库, 将数据插入主表vocs_gather_txt_gc取得pid
                 //连接数据库, 将数据插入主表vocs_gather_txt_gc取得pid
-                $pid = db()->table('gather_txt_gcms')->insertGetId($res);
+                $pid = db()->name('gather_txt_gcms')->insertGetId($res);
 
 
                 $row = [];
                 $row = [];
                 $j = 0;
                 $j = 0;
@@ -173,7 +173,7 @@ class Index extends Api
                     $j++;
                     $j++;
                 }
                 }
                 //将检测数据插入子表vocs_gather_txt_check_gc
                 //将检测数据插入子表vocs_gather_txt_check_gc
-                $id = db()->table('gather_txt_check_gcms')->insertAll($row);
+                $id = db()->name('gather_txt_check_gcms')->insertAll($row);
                 //提交事务
                 //提交事务
                 db()->commit();
                 db()->commit();