...
|
...
|
@@ -70,6 +70,21 @@ func UpdateChanceDraftById(m *ChanceDraft) (err error) { |
|
|
return
|
|
|
}
|
|
|
|
|
|
// DeleteChanceDraft deletes ChanceDraft by Id and returns error if
|
|
|
// the record to be deleted doesn't exist
|
|
|
func DeleteChanceDraftById(id int64) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
v := ChanceDraft{Id: id}
|
|
|
// ascertain id exists in the database
|
|
|
if err = o.Read(&v); err == nil {
|
|
|
var num int64
|
|
|
if num, err = o.Delete(&ChanceDraft{Id: id}); err == nil {
|
|
|
fmt.Println("Number of records deleted in database:", num)
|
|
|
}
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//草稿项机会列表
|
|
|
func GetDraftByChance(uid int64, offset int, pageSize int, v interface{}) (total int, err error) {
|
|
|
sql := fmt.Sprintf(`select a.*,b.images,b.speechs,b.videos
|
...
|
...
|
|