优化backend产品和解决方案
This commit is contained in:
@@ -2,8 +2,6 @@ package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
type BackendMenuFront struct {
|
||||
@@ -27,7 +25,3 @@ type BackendMenuFront struct {
|
||||
func (m *BackendMenuFront) TableName() string {
|
||||
return "yz_backend_menu_front"
|
||||
}
|
||||
|
||||
func init() {
|
||||
orm.RegisterModel(new(BackendMenuFront))
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ type CmsSolution struct {
|
||||
Title string `orm:"column(title);size(100)" json:"title"`
|
||||
Thumb string `orm:"column(thumb);size(500);default()" json:"thumb"`
|
||||
Desc string `orm:"column(desc);size(500);default()" json:"desc"`
|
||||
Content string `orm:"column(content);type(mediumtext);null" json:"content"`
|
||||
URL string `orm:"column(url);size(500);default()" json:"url"`
|
||||
Sort int `orm:"column(sort);default(0)" json:"sort"`
|
||||
Status int8 `orm:"column(status);default(1)" json:"status"`
|
||||
@@ -55,6 +56,7 @@ CREATE TABLE IF NOT EXISTS yz_cms_solution (
|
||||
title varchar(100) NOT NULL DEFAULT '',
|
||||
thumb varchar(500) NOT NULL DEFAULT '',
|
||||
` + "`desc`" + ` varchar(500) NOT NULL DEFAULT '',
|
||||
content mediumtext,
|
||||
url varchar(500) NOT NULL DEFAULT '',
|
||||
sort int NOT NULL DEFAULT 0,
|
||||
status tinyint NOT NULL DEFAULT 1,
|
||||
@@ -67,6 +69,8 @@ CREATE TABLE IF NOT EXISTS yz_cms_solution (
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// 确保已有表补齐 content 字段
|
||||
_, _ = Orm.Raw("ALTER TABLE yz_cms_solution ADD COLUMN content mediumtext").Exec()
|
||||
_, err = Orm.Raw(`
|
||||
CREATE TABLE IF NOT EXISTS yz_cms_solution_category (
|
||||
id bigint unsigned NOT NULL AUTO_INCREMENT,
|
||||
|
||||
@@ -69,11 +69,16 @@ func Init(_ string) {
|
||||
|
||||
new(CmsArticleCategory),
|
||||
new(CmsArticle),
|
||||
new(CmsProductCategory),
|
||||
new(CmsProduct),
|
||||
new(CmsSolutionCategory),
|
||||
new(CmsSolution),
|
||||
|
||||
new(CmsFrontendTemplate),
|
||||
new(CmsFrontendBanner),
|
||||
new(CmsFrontendFriendlink),
|
||||
new(CmsFrontendOnepage),
|
||||
new(BackendMenuFront),
|
||||
|
||||
new(SystemReminderList),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user