setAttr('id', null)->isUpdate(false)->allowField(true)->save($arr); return $this->id; } /*** * 20210903 * wj * 根据条件获取数据 */ public function getinfo($where, $row = true) { $query = $this->where($where); if ($row) { $info = $query->find(); } else { $info = $query->select(); } return $info; } /*** * 20210903 * wj * 根据id条件获取数据 */ public function getinfobyid($id) { $where['id'] = $id; $info = $this->where($where)->find(); return $info; } /*** * 20210903 * wj * 删除已用验证码 */ public function deletebyid($id) { $where['id'] = $id; $result = $this->where($where)->delete(); return $result; } public function getlastinfo($where) { $info = $this->where($where)->limit(1)->order('id', 'desc')->find(); return $info; } }