-
-
Save DBasic/9435732 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @static Вызов хранимой процедуры | |
* @param $sp_name Название хранимой процедуры | |
* @param $params | |
* @return array | |
*/ | |
public static function Query($sp_name, $params) | |
{ | |
// Получаем CommandBuilder | |
$b = Yii::app()->db->getCommandBuilder(); | |
// Создаём команду | |
$pars = implode(',', array_keys($params)); | |
$cmd = $b->createSqlCommand("CALL $sp_name($pars)", $params); | |
// Получаем все записи | |
return $cmd->queryAll(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment