package yb_community_question_process

import (
	"hongze/hongze_yb/global"
)

func (item *YbCommunityQuestionProcess) Create() (err error) {
	err = global.DEFAULT_MYSQL.Create(item).Error
	return
}

func (item *YbCommunityQuestionProcess) Update(updateCols []string) (err error) {
	err = global.DEFAULT_MYSQL.Model(item).Select(updateCols).Updates(*item).Error
	return
}

func GetListByQuestionId(questionId int) (items []*YbCommunityQuestionProcess, err error) {
	err = global.DEFAULT_MYSQL.Model(YbCommunityQuestionProcess{}).
		Where("community_question_id = ?", questionId).
		Order("create_time DESC").
		Scan(&items).Error
	return
}
