打印sql语句:
$model->find()->createCommand()->getRawSql();
批量插入
Yii::$app->db->createCommand()->batchInsert(UserModel::tableName(), ['user_id','username'], [
['1','test1'],
['2','test2'],
['3','test3'],
])->execute();
打印sql语句:
$model->find()->createCommand()->getRawSql();
批量插入
Yii::$app->db->createCommand()->batchInsert(UserModel::tableName(), ['user_id','username'], [
['1','test1'],
['2','test2'],
['3','test3'],
])->execute();