12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package frontc
- import (
- "wuyebaoxiuapi/models/commonm"
- "github.com/astaxie/beego"
- "time"
- )
- type PropertyNoticeController struct {
- BaseController
- }
- func (this *PropertyNoticeController)List() {
- this.Prepare()
- //列表
- page, err := this.GetInt("page")
- if err != nil {
- page = 1
- }
- limit, err := this.GetInt("limit")
- if err != nil {
- limit = 30
- }
- propertyNotice := commonm.NewPropertyNotice()
- result, count := propertyNotice.FindPropertyNotices(page, limit)
- for k, v := range result {
- propertyNotice := commonm.NewPropertyNotice()
- propertyNotice.Id = v.Id
- propertyNotice.Title = v.Title
- propertyNotice.FCreateTime = beego.Date(time.Unix(int64(v.CreateTime), 0), "Y年m月d日")
- result[k] = propertyNotice
- }
- this.ajaxList(MSG_OK,"成功" , count, result)
- }
- func (this *PropertyNoticeController)Detail() {
- this.Prepare()
- id, _ := this.GetInt("id")
- propertyNotice := commonm.NewPropertyNotice()
- propertyNotice,_ = propertyNotice.FindPropertyNoticeById(id)
- this.ajaxMsg(MSG_OK,"",propertyNotice)
- }
|