use think\Validate;
]; public function addInfoData($member_id, $type, $money, $invoice_name, $invoice_tel, $email, $taxpayer_number, $id) { $data = [ 'type' => $type, 'invoice_tel' => $invoice_tel, 'email' => $email, ]; $validate = new Validate($this->rule, $this->message); if (!$validate->check($data)) { return ['code' => 400, 'msg' => $validate->getError()]; } } }