作者 开飞机的舒克

条形码生成优化

... ... @@ -336,10 +336,9 @@ class Study extends Backend
}
$result = $this->model->allowField(true)->save($params);
$id = $this->model->id;
$unique = time();
$sno = $this->model->sno;
$barpath = Resource::StudyBar($sno);
$this->model->save(['barcode'=>$barpath,'unique'=>$unique],['id'=>$id]);
$this->model->save(['barcode'=>$barpath,'unique'=>$sno],['id'=>$id]);
Db::commit();
} catch (ValidateException|PDOException|Exception $e) {
Db::rollback();
... ...