Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrycrocodic committed Oct 15, 2020
1 parent dd4a00f commit cf97cfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/CBController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1142,13 +1142,13 @@ public function postAddSave()

$this->hook_before_add($this->arr);

// $this->arr[$this->primary_key] = $id = CRUDBooster::newId($this->table); //error on sql server
$lastInsertId = $id = DB::table($this->table)->insertGetId($this->arr);

//fix bug if primary key is uuid
if($this->arr[$this->primary_key]!=$id)
if(isset($this->arr[$this->primary_key]) && $this->arr[$this->primary_key]!=$id) {
$id = $this->arr[$this->primary_key];

}

//Looping Data Input Again After Insert
foreach ($this->data_inputan as $ro) {
$name = $ro['name'];
Expand Down

0 comments on commit cf97cfe

Please sign in to comment.