1. Checking the existing API response, “status”: “1”,. The status field is of type tinyint in the table. See Figure 1.

2. Adjust the configuration in components[‘db’] by adding attributes[PDO::ATTR_STRINGIFY_FETCHES] => false and attributes[PDO::ATTR_EMULATE_PREPARES] => false.
PHP
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=apply_server_v6',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8mb4',
'attributes' => [
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
],
],
],
];
3. Check the API response again. The field types are now consistent with MySQL, as expected. See Figure 2.

