标签:this nbsp prot func voice type 类型 turn erro
use think\Validate;
<?php namespace app\common\model; use think\Validate; use think\Db; class InvoiceRecords extends BaseModel { protected $table = ‘t_invoice_record‘; protected $rule = [ ‘type‘ => ‘in:1,2‘, ‘invoice_tel‘ => ‘mobile‘, ‘email‘ => ‘email‘, ]; protected $message = [ ‘type‘ => ‘开票类型错误‘, ‘invoice_tel‘ => ‘手机号错误‘, ‘email‘ => ‘邮箱格式错误‘, ]; 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()]; } } }
标签:this nbsp prot func voice type 类型 turn erro
原文地址:https://www.cnblogs.com/camg/p/11999978.html