property_notice.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package frontc
  2. import (
  3. "wuyebaoxiuapi/models/commonm"
  4. "github.com/astaxie/beego"
  5. "time"
  6. )
  7. type PropertyNoticeController struct {
  8. BaseController
  9. }
  10. func (this *PropertyNoticeController)List() {
  11. this.Prepare()
  12. //列表
  13. page, err := this.GetInt("page")
  14. if err != nil {
  15. page = 1
  16. }
  17. limit, err := this.GetInt("limit")
  18. if err != nil {
  19. limit = 30
  20. }
  21. propertyNotice := commonm.NewPropertyNotice()
  22. result, count := propertyNotice.FindPropertyNotices(page, limit)
  23. for k, v := range result {
  24. propertyNotice := commonm.NewPropertyNotice()
  25. propertyNotice.Id = v.Id
  26. propertyNotice.Title = v.Title
  27. propertyNotice.FCreateTime = beego.Date(time.Unix(int64(v.CreateTime), 0), "Y年m月d日")
  28. result[k] = propertyNotice
  29. }
  30. this.ajaxList(MSG_OK,"成功" , count, result)
  31. }
  32. func (this *PropertyNoticeController)Detail() {
  33. this.Prepare()
  34. id, _ := this.GetInt("id")
  35. propertyNotice := commonm.NewPropertyNotice()
  36. propertyNotice,_ = propertyNotice.FindPropertyNoticeById(id)
  37. this.ajaxMsg(MSG_OK,"",propertyNotice)
  38. }