0

我正在尝试调用suppliers_master_id 中的函数值,但它显示错误

我的代码

 public $form = [
'supplier'          => '',
'email'              => '',
'phone'              => '',
'address'            => '',
'city'               => '',
'state'              => '',
'pincode'            => '',
'GSTIN'              => '',
'suppliers_master_id' => $this->generateRegistrationId()

];

功能码

    function generateRegistrationId() {
    $id = 'SIIT_' . mt_rand(1000000000, 9999999999);

      if ($this->registrationIdExists($id)) {
        return $this->generateRegistrationId();
    }
    return $id;
     }
    function registrationIdExists($id) {
    return Supplier::where('suppliers_master_id', $id)->exists();
    }
4

0 回答 0