...
|
...
|
@@ -132,17 +132,9 @@ class Study extends Backend |
|
|
$row[$fieldArr[$k]] = $v;
|
|
|
}
|
|
|
}
|
|
|
//自动生成条形码
|
|
|
if ($row) {
|
|
|
$insert[] = $row;
|
|
|
}
|
|
|
$id = \db('study')->order('id','desc')->value('id');
|
|
|
$ids = $allRow+$id+1;
|
|
|
dump($ids);
|
|
|
$res = str_pad($ids,8,"0",STR_PAD_LEFT);
|
|
|
$barpath = Resource::StudyBar($res);
|
|
|
$insert['barcode'] = $barpath;
|
|
|
$insert['unique'] = $res;
|
|
|
}
|
|
|
} catch (Exception $exception) {
|
|
|
$this->error($exception->getMessage());
|
...
|
...
|
@@ -168,7 +160,9 @@ class Study extends Backend |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$this->model->saveAll($insert);
|
|
|
|
|
|
return $this->model->saveAll($insert);
|
|
|
|
|
|
} catch (PDOException $exception) {
|
|
|
$msg = $exception->getMessage();
|
|
|
if (preg_match("/.+Integrity constraint violation: 1062 Duplicate entry '(.+)' for key '(.+)'/is", $msg, $matches)) {
|
...
|
...
|
|