0
点赞
收藏
分享

微信扫一扫

fastadmin字段唯一性验证-靳宇灵

舟海君 2022-12-19 阅读 31

<input id="c-materialcode" class="form-control" name="row[materialcode]" type="text" data-rule="required;remote(product/tuzhi/check)">

  • 字段唯一性验证

public function check()

   {

       $params = $this->request->post('row/a');

       $materialcode = $params['materialcode'];

       $materialcode = Db::table('tt_product_machine')->where('materialcode',$materialcode)->find();

       if($materialcode!=NULL){

           return $this->error('编码已存在,重新输入!');

       }else{

           return $this->success('编码可用!');

       }

       

   }

举报

相关推荐

0 条评论