package models_func import ( "errors" e "github.com/dabory/abango-rest/etc" "github.com/go-xorm/xorm" ) type DealTypeSelect struct { Id int `xorm:"not null pk autoincr INT(10)"` CreatedOn int64 `xorm:"not null BIGINT(11)"` UpdatedOn int64 `xorm:"not null BIGINT(11)"` DealCategory string `xorm:"VARCHAR(21)"` SortNo int `xorm:"not null TINYINT(4)"` DealCode string `xorm:"VARCHAR(2)"` DealName string `xorm:"VARCHAR(21)"` SalesStatus int `xorm:"not null TINYINT(4)"` PurchStatus int `xorm:"not null TINYINT(4)"` CollectStatus int `xorm:"not null default 0 TINYINT(4)"` StockStatus int `xorm:"not null default 0 TINYINT(4)"` BadstkStatus int `xorm:"not null TINYINT(4)"` CoststkStatus int `xorm:"not null TINYINT(4)"` CreditStatus int `xorm:"not null TINYINT(4)"` RewardStatus int `xorm:"not null TINYINT(4)"` ExDateStatus int `xorm:"not null TINYINT(4)"` IsGenIo int `xorm:"not null TINYINT(4)"` IsReqRetro int `xorm:"not null TINYINT(4)"` GenIoPrtField string `xorm:"VARCHAR(49)"` } type DealTypeSelectPage struct { Page []DealTypeSelect } func GetDealTypeSelect(YDB *xorm.Engine, sel *DealTypeSelectPage, deal string) error { qry := *YDB.Table("dbr_deal_type").Asc("sort_no") if deal != "" { qry = *qry.Where(deal) // qry = *qry.Where("deal_category='" + deal + "'") } if err := qry.Find(&sel.Page); err == nil { e.FuncRun("234adsrared", e.CurrFuncName()) return nil } else { return errors.New(e.PageQryErr("ltrysgaera", e.CurrFuncName()+err.Error())) } }