123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace catchAdmin\wechat\model;
- use catcher\base\CatchModel as Model;
- use catchAdmin\wechat\model\NoticeGet;
- use catchAdmin\wechat\model\search\NoticeSearchTrait;
- use catchAdmin\permissions\model\DataRangScopeTrait;
- class Notice extends Model
- {
- use NoticeGet;
- use NoticeSearchTrait;
- use DataRangScopeTrait;
- // 表名
- public $name = 'notice';
- // 数据库字段映射
- public $field = array(
- 'id',
- // 标题
- 'title',
- // 内容
- 'content',
- // 作者
- 'author',
- // 发布时间
- 'put_time',
- // 显示开始时间
- 'start_time',
- // 显示结束时间
- 'end_time',
- // 0-学校公告 1-班级公告
- 'type',
- // 学校id
- 'school_id',
- // 年级id
- 'grade_id',
- // 班级id
- 'class_id',
- // 0-禁用 1-启用
- 'enable',
- // 创建人ID
- 'creator_id',
- // 创建时间
- 'created_at',
- // 更新时间
- 'updated_at',
- // 软删除
- 'deleted_at',
- );
- /**
- * 获取公告列表
- */
- public function getList(){
- return $this->dataRange()
- ->catchSearch()
- ->append(['department_id','school_name','grade_name','class_name','type_text','enable_text'])
- ->order($this->aliasField('id'), 'desc')
- ->paginate();
- }
- }
|