Return insertId instead of numrows
This commit is contained in:
parent
34c8ab53dc
commit
173dae0381
@ -6,12 +6,15 @@ class Op {
|
|||||||
|
|
||||||
public static function add($op){
|
public static function add($op){
|
||||||
$query = \OCP\DB::prepare('INSERT INTO `*PREFIX*office_op` (`es_id`, `member`, `opspec`) VALUES (?, ?, ?) ');
|
$query = \OCP\DB::prepare('INSERT INTO `*PREFIX*office_op` (`es_id`, `member`, `opspec`) VALUES (?, ?, ?) ');
|
||||||
$result = $query->execute(array(
|
$query->execute(array(
|
||||||
$op['es_id'],
|
$result = $op['es_id'],
|
||||||
$op['member'],
|
$op['member'],
|
||||||
$op['opspec'],
|
$op['opspec'],
|
||||||
));
|
));
|
||||||
return $result;
|
if ($result){
|
||||||
|
return \OCP\DB::insertid(`*PREFIX*office_op`);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getHeadSeq($esId){
|
public static function getHeadSeq($esId){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user