作者 开飞机的舒克

后台功能修改

... ... @@ -180,8 +180,10 @@ class Study extends Backend
}
$result = $this->model->allowField(true)->save($params);
$id = $this->model->id;
$brpath = Resource::StudyBar($id);
$this->model->save(['barcode'=>$brpath],['id'=>$id]);
$unique = time();
$brpath = Resource::StudyBar($unique);
$time = date('YmdHi',time());
$this->model->save(['barcode'=>$brpath],['sno'=>$time],['id'=>$id]);
Db::commit();
} catch (ValidateException|PDOException|Exception $e) {
Db::rollback();
... ...
... ... @@ -6,10 +6,10 @@ use tinymeng\code\Generate;
class Resource
{
public static function StudyBar($id){
public static function StudyBar($unique){
$generate = Generate::qr();
/** 直接输出图片 */
$file_path = $generate->create($id,true);
$file_path = $generate->create($unique,true);
$file_path = substr($file_path,strripos($file_path,"public")+6);
return $file_path;
}
... ...