$countTrailEnd = ceil(count($dataTrailEnd)/$step);
for($k=0;$k<$countTrailEnd;$k++){
$prebookTrailDataEnd = array_slice($dataTrailEnd,$k*$step,$step,true);//切割数组
$query = $connect->createCommand()->batchInsert(\frontend\modules\policy\models\OcrPrebookTrail::tableName()
,[
'prebook_id',
'prebook_status',
'operator_id',
'operator_name',
'create_time',
'remark',
],$prebookTrailDataEnd);
//相当于insert into table values(),(),();
if(!$query->execute()){
Yii::warning("没有添加轨迹数据的上一个id为:".$connect->getLastInsertID()."中".PHP_EOL);
}
}