saveAll($data); return true; } /** * 校验码是否用过 * @param $code * @return bool * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function checkExistedCode($code){ $m = new self(); if ($m->where('redeem_code',$code)->find()){ return true; } return false; } }