作者 开飞机的舒克

后台导入生成条形码

... ... @@ -132,6 +132,12 @@ class Study extends Backend
$row[$fieldArr[$k]] = $v;
}
}
$id = \db('study')->max('id');
$ids = $allRow+$id-1;
$res = str_pad($ids,8,"0",STR_PAD_LEFT);
$barpath = Resource::StudyBar($res);
$row['barcode'] = $barpath;
$row['unique'] = $res;
if ($row) {
$insert[] = $row;
}
... ... @@ -160,12 +166,6 @@ class Study extends Backend
}
}
}
$id = \db('study')->max('id');
$ids = $allRow+$id-1;
$res = str_pad($ids,8,"0",STR_PAD_LEFT);
$barpath = Resource::StudyBar($res);
$insert['barcode'] = $barpath;
$insert['unique'] = $res;
$this->model->saveAll($insert);
} catch (PDOException $exception) {
$msg = $exception->getMessage();
... ...