预处理插入大数据
$chu=(int)($count/5000);
$yu=$count%5000;
for($i=0;$i<$chu;$i++){
$value='';
for($j=$i*5000;$j<($i+1)*5000;$j++){
$values.='("'.$codeModel[$j]['rid'].'","'.$codeModel[$j]['cid'].'"),';
}
$sql="insert into w_code(rid,cid) values".$values;
Yii::app()->db->createCommand($sql)->execute();
}
}
for($k=$chu*2000;$k<$chu*2000+$yu;$k++){
$values.='("'.$rs[$k]['taskprogressid'].'","'.$rs[$k]['pic'].'"),';
$sql="insert into w_code(rid,cid) values".$values;
Yii::app()->db->createCommand($sql)->execute();
}