You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
3.7 KiB
56 lines
3.7 KiB
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/ouxuanserver/osmanthuswine/src/core"
|
|
)
|
|
|
|
const ActivityModuleServiceTableName = TableNamePrefix + "activity_module_service"
|
|
|
|
//活动模块服务
|
|
type ActivityModuleService struct {
|
|
Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
|
|
ActivityId int64 `json:"activity_id" xorm:"not null comment('主活动id') INT(11)"`
|
|
ServiceModuleHistoryId int64 `json:"service_module_history_id" xorm:"not null comment('service_module_history表id') INT(11)"`
|
|
ServiceModuleName string `json:"service_module_name" xorm:"-" description:"模块服务名字"`
|
|
ServiceModuleStatus string `json:"service_module_status" xorm:"not null default('关闭') comment('服务模块 免费开启。付费默认关闭。') VARCHAR(128)"`
|
|
PhoneBgUrl string `json:"phone_bg_url" xorm:"not null default('') comment('服务模块的自定义手机屏的图片') VARCHAR(255)"`
|
|
PhoneBgSwitch string `json:"phone_bg_switch" xorm:"not null default('关闭') comment('模块手机的开关 开启|关闭') VARCHAR(11)"`
|
|
MaxBgUrl string `json:"max_bg_url" xorm:"not null default('') comment('服务模块的自定义大屏的图片') VARCHAR(255)"`
|
|
MaxBgSwitch string `json:"max_bg_switch" xorm:"not null default('关闭') comment('模块大屏的开关 开启|关闭') VARCHAR(11)"`
|
|
ModuleStyleId int64 `json:"module_style_id" xorm:"not null default(0) comment('每个模块对应的一个样式id 如果有的话') INT(11)"`
|
|
BesideRepeat string `json:"beside_repeat" xorm:"not null default('不去除') comment('是否去除重复') VARCHAR(11)"`
|
|
ServiceModuleStartTime time.Time `json:"service_module_start_time" xorm:"not null default('1970-01-01 08:00:00') comment('服务开始时间') DATETIME"`
|
|
ServiceModuleEndTime time.Time `json:"service_module_end_time" xorm:"not null default('1970-01-01 08:00:00') comment('服务结束时间') DATETIME"`
|
|
MoreAreaMode string `json:"more_area_mode" xorm:"not null default('关闭') comment('多地区模式录入人员用到') VARCHAR(11)"`
|
|
OrderDrawStatus string `json:"order_draw_status" xorm:"not null default('关闭') comment('订单抽奖开关[开启|关闭]') VARCHAR(11)"`
|
|
IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(1)"`
|
|
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME" description:"创建时间"`
|
|
UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME" description:"更新时间"`
|
|
}
|
|
|
|
/**
|
|
* 获取手机和大屏的背景图:
|
|
* 通过主活动的id定位activity_module_service的所有service_module_history_id,
|
|
* 所有service_module_history_id in module_service_history,并且 模块名=module_service_history.name
|
|
* 通过定位出来的activity_module_service检查是否手机和大屏的背景图状态,开启则从ui_base获取,否则直接从activity_module_service
|
|
*/
|
|
|
|
func (t *ActivityModuleService) TableName() string {
|
|
return ActivityModuleServiceTableName
|
|
}
|
|
|
|
func (t *ActivityModuleService) Alias(name string) string {
|
|
return AliasTableName(t, name)
|
|
}
|
|
|
|
//
|
|
//func (t *ActivityModuleService) GetByActivityIdAndHistoryId(aid, hid int64) (bool, error) {
|
|
// return core.GetXormAuto().Where("is_delete=0 and activity_id=? and service_module_history_id=?", aid, hid).Get(t)
|
|
//}
|
|
|
|
func (t *ActivityModuleService) GetByActivityIdAndHistoryIds(activityId, historyIds interface{}) (bool, error) {
|
|
return core.GetXormAuto().Where("is_delete=0 and activity_id=?", activityId).
|
|
In("service_module_history_id", historyIds).Get(t)
|
|
}
|