Yii2 gets the sql statement executed by the current program

1. Yii2 obtains the sql statement executed by the current program:

$query = model::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pagesize' => '25',
            ]
        ]);

//Get the sql statement executed by the current program

$query->createCommand()->getRawSql();

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325890355&siteId=291194637
Recommended