func (t MenuModel) Update(title, icon, uri, header, pluginName string, parentId int64) (int64, error) {
	return t.Table(t.TableName).
		Where("id", "=", t.Id).
		Update(dialect.H{
			"title":       title,
			"parent_id":   parentId,
			"icon":        icon,
			"plugin_name": pluginName,
			"uri":         uri,
			"header":      header,
			"updated_at":  time.Now().Format("2006-01-02 15:04:05"),
		})
}
Update update the menu model.
package models
import (
	"encoding/json"
	"strconv"
	"time"
	"github.com/GoAdminGroup/go-admin/modules/db"
	"github.com/GoAdminGroup/go-admin/modules/db/dialect"
)
type MenuModel struct {
	Base
	Id        int64
	Title     string
	ParentId  int64
	Icon      string
	Uri       string
	Header    string
	CreatedAt string
	UpdatedAt string
}
func Menu() MenuModel {
	return MenuModel{Base: Base{TableName: "goadmin_menu"}}
}
func MenuWithId(id string) MenuModel {
	idInt, _ := strconv.Atoi(id)
	return MenuModel{Base: Base{TableName: "goadmin_menu"}, Id: int64(idInt)}
}
func (t MenuModel) SetConn(con db.Connection) MenuModel {
	t.Conn = con
	return t
}
func (t MenuModel) Find(id interface{}) MenuModel {
	item, _ := t.Table(t.TableName).Find(id)
	return t.MapToModel(item)
}
func (t MenuModel) New(title, icon, uri, header, pluginName string, parentId, order int64) (MenuModel, error) {
	id, err := t.Table(t.TableName).Insert(dialect.H{
		"title":       title,
		"parent_id":   parentId,
		"icon":        icon,
		"uri":         uri,
		"order":       order,
		"header":      header,
		"plugin_name": pluginName,
	})
	t.Id = id
	t.Title = title
	t.ParentId = parentId
	t.Icon = icon
	t.Uri = uri
	t.Header = header
	return t, err
}
func (t MenuModel) Delete() {
	_ = t.Table(t.TableName).Where("id", "=", t.Id).Delete()
	_ = t.Table("goadmin_role_menu").Where("menu_id", "=", t.Id).Delete()
	items, _ := t.Table(t.TableName).Where("parent_id", "=", t.Id).All()
	if len(items) > 0 {
		ids := make([]interface{}, len(items))
		for i := 0; i < len(ids); i++ {
			ids[i] = items[i]["id"]
		}
		_ = t.Table("goadmin_role_menu").WhereIn("menu_id", ids).Delete()
	}
	_ = t.Table(t.TableName).Where("parent_id", "=", t.Id).Delete()
}