Advertisement
joris

test

Apr 19th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. protected function afterSave() {
  2.      $this->wo_number                = self::genCodeNumb(Yii::app()->user->id, Yii::app()->db->getLastInsertID());
  3.      return parent::afterSave();
  4. }
  5.      
  6. public function genCodeNumb($idlog,$lastid)
  7. {
  8.      $sql = "SELECT sys_generate_wo_number(".$idlog.",".$lastid.") AS distnumb FROM DUAL";
  9.      $connection=Yii::app()->db;
  10.      $command=$connection->createCommand($sql);
  11.      $dataReader=$command->queryScalar();
  12.      echo $dataReader;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement