|
@@ -4,6 +4,7 @@ import (
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
"github.com/beego/beego/v2/client/orm"
|
|
|
+ "github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -72,6 +73,7 @@ type BaseFromSmmIndex struct {
|
|
|
Sort int
|
|
|
CreateTime time.Time
|
|
|
ModifyTime time.Time
|
|
|
+ data_state string
|
|
|
}
|
|
|
|
|
|
func AddBaseFromSmmIndex(item *BaseFromSmmIndex) (lastId int64, err error) {
|
|
@@ -327,3 +329,32 @@ type SmmSingleDataResp struct {
|
|
|
ModifyTime string
|
|
|
Data []*SmmIndexData
|
|
|
}
|
|
|
+
|
|
|
+func GetSmmIndexDataList(condition, sortStr string, pars []interface{}, startSize, pageSize int) (items []*BaseFromSmmIndex, err error) {
|
|
|
+ sql := `select * FROM base_from_smm_index
|
|
|
+ WHERE 1=1 `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ sql += ` ORDER BY ` + sortStr
|
|
|
+ sql += ` limit ?,? `
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func GetSmmIndexDataListCount(condition string, pars []interface{}) (total int, err error) {
|
|
|
+ sql := `select count(1) FROM base_from_smm_index
|
|
|
+ WHERE 1=1 `
|
|
|
+ if condition != "" {
|
|
|
+ sql += condition
|
|
|
+ }
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ err = o.Raw(sql, pars).QueryRow(&total)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+type BaseFromSmmIndexListResp struct {
|
|
|
+ List []*BaseFromSmmIndex
|
|
|
+ Paging *paging.PagingItem `description:"分页数据"`
|
|
|
+}
|