|
发表于 2025-2-21 10:10:14
|
|
本帖最后由 追影 于 2025-2-21 16:13 编辑
- $params = $this->request->post();
- try {
- $this->validate($params, ['machine_no' => 'require|unique:machine'], ['machine_no.require'=>'设别编码必须','machine_no.unique'=>'已经存在该设备编码']);
- } catch (validateexception $e) {
- // 验证失败 输出错误信息
- $this->error($e->geterror());
- }
复制代码
|
|