$data = [ 'audit_id' => 1, 'num' =>1, 'add_time' =>0 ]; $connection = \Yii::$app->db; $connection->createCommand()->batchInsert( 'audit', ['audit_id', 'num', 'add_time'], //表和字段 $data )->execute();
关键字词:
$data = [ 'audit_id' => 1, 'num' =>1, 'add_time' =>0 ]; $connection = \Yii::$app->db; $connection->createCommand()->batchInsert( 'audit', ['audit_id', 'num', 'add_time'], //表和字段 $data )->execute();