操作日志记录增加门店相关
This commit is contained in:
@@ -40,7 +40,7 @@ func DeleteOperateEvent(db *DaoDB, deleteTime time.Time) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func GetOperateEvents(db *DaoDB, apiFunction, name string, operateType int, skuIDs, storeIDs []int, fromTime, toTime time.Time, offset, pageSize int) (operateEventExt []*OperateEventExt, totalCount int, err error) {
|
||||
func GetOperateEvents(db *DaoDB, name string, apiFunctions []string, operateTypes, skuIDs, storeIDs []int, fromTime, toTime time.Time, offset, pageSize int) (operateEventExt []*OperateEventExt, totalCount int, err error) {
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS DISTINCT a.*, c.name
|
||||
FROM operate_event a
|
||||
@@ -61,13 +61,13 @@ func GetOperateEvents(db *DaoDB, apiFunction, name string, operateType int, skuI
|
||||
sql += " AND a.created_at <= ?"
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
if apiFunction != "" {
|
||||
sql += " AND a.api_function = ?"
|
||||
sqlParams = append(sqlParams, apiFunction)
|
||||
if len(apiFunctions) > 0 {
|
||||
sql += " AND a.api_function IN (" + GenQuestionMarks(len(apiFunctions)) + ")"
|
||||
sqlParams = append(sqlParams, apiFunctions)
|
||||
}
|
||||
if operateType != 0 {
|
||||
sql += " AND b.operate_type = ?"
|
||||
sqlParams = append(sqlParams, operateType)
|
||||
if len(operateTypes) > 0 {
|
||||
sql += " AND b.operate_type IN (" + GenQuestionMarks(len(operateTypes)) + ")"
|
||||
sqlParams = append(sqlParams, operateTypes)
|
||||
}
|
||||
if len(skuIDs) > 0 {
|
||||
sql += " AND b.thing_id IN (" + GenQuestionMarks(len(skuIDs)) + ")"
|
||||
|
||||
@@ -9,6 +9,7 @@ type OperateEvent struct {
|
||||
AccessUUID string `orm:"column(access_uuid)" json:"accessUUID"`
|
||||
UserID string `orm:"column(user_id)" json:"userID"`
|
||||
APIFunction string `orm:"column(api_function)" json:"apiFunction"`
|
||||
JsonData string `orm:"size(3200)" json:"jsonData"`
|
||||
}
|
||||
|
||||
func (v *OperateEvent) TableIndex() [][]string {
|
||||
|
||||
@@ -117,8 +117,8 @@ type StoreSkuBind struct {
|
||||
|
||||
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`
|
||||
|
||||
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
|
||||
StatusSaleEnd int16 `json:"statusSaleEnd"`
|
||||
StatusSaleBegin int16 //商品可售时间范围
|
||||
StatusSaleEnd int16
|
||||
}
|
||||
|
||||
func (*StoreSkuBind) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user