Created
October 16, 2015 05:03
-
-
Save des1roer/2e4bf07f2fb9e8a217f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public static function new_shihta($id_template, $time, $temp_name) | |
{ | |
$new_shihta = Yii::app()->db->createCommand() | |
->select('id') | |
->from('vgok_site.a_analiz_create') | |
->where("template_id = $id_template | |
AND f_timestamp = '$time'") | |
->queryScalar(); | |
if (!empty($new_shihta)) | |
{ | |
return $new_shihta; | |
} | |
else | |
{ | |
$command = Yii::app()->db->createCommand(); | |
$command->insert('vgok_site.a_analiz_create', array( | |
'name' => $temp_name, | |
'template_id' => $id_template, | |
'f_timestamp' => $time, | |
)); | |
$insert_id = Yii::app()->getComponent('db')->getLastInsertID('a_analiz_create_id_seq1'); | |
return $insert_id; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment