|
@@ -85,13 +85,22 @@ class Operating extends Controller
|
|
|
$handleInfo['code'] = 0;
|
|
|
if($handleInfo['code'] == 0)
|
|
|
{
|
|
|
- $insert = $handleInfo['data'];
|
|
|
- foreach ($insert as $k=>$v)
|
|
|
+ $insert_handle = $handleInfo['data'];
|
|
|
+ $history = DB::table('yyk')->column('exam_id');
|
|
|
+ $insert = [];
|
|
|
+ foreach ($insert_handle as $k=>$v)
|
|
|
{
|
|
|
+ if(in_array($v['exam_id'],$history))
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $insert[$k] = $v;
|
|
|
$insert[$k]['start_time'] = $startTime;
|
|
|
$insert[$k]['end_time'] = $finishTime;
|
|
|
}
|
|
|
- DB::table('yyk')->insertAll($insert);
|
|
|
+ if(!empty($insert)){
|
|
|
+ DB::table('yyk')->insertAll($insert);
|
|
|
+ }
|
|
|
return json_encode(['code'=>'0000','status'=>'ok','msg'=>'请求成功']);
|
|
|
}else{
|
|
|
return $return;
|