numsigng(); foreach ($data as $k => $value) { if (is_null($k)) { return '用户提交表单参数错误'; } } $data['addtime'] = time(); $data['password'] = md5(md5($data['password']) . $stringrand); $data['salt'] = $stringrand; return $this->insertGetId($data); } //生成随机字符串 private function numsigng() : int{ $code = ''; for ($i=1;$i<7;$i++) { $randcode = mt_rand(0,9); $code .= $randcode; } return (int)$code; } }