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