123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- /*
- * @Descripttion:
- * @version: 1.0.0
- * @Author: likang
- * @Date: 2022-07-09 16:57:43
- * @LastEditors: likang
- * @LastEditTime: 2022-08-02 19:58:38
- */
- namespace catchAdmin\api\model;
- use catchAdmin\permissions\model\DataRangScopeTrait;
- use catcher\base\CatchModel as Model;
- use catcher\traits\db\BaseOptionsTrait;
- use catcher\traits\db\ScopeTrait;
- class PublishAck extends Model
- {
- use DataRangScopeTrait;
- // 表名
- public $name = 'publish_ack';
- // 数据库字段映射
- public $field = array(
- 'id',
- // 版本
- 'PublishVersion',
- // 下发的内容
- 'PublishContent',
- // 创建时间
- 'AddTime',
- // 1 成功 -1 失败
- 'Succ',
- // 回复时间
- 'AckTime',
- // 回复的内容
- 'Extra',
- //网关Imei号
- 'Imei',
- );
- public function getList()
- {
- $res = $this->dataRange()
- ->catchSearch()
- ->order($this->aliasField('id'), 'desc')
- ->paginate();
- return $res;
- }
- public function getAddTimeAttr()
- {
- $addtime = $this->getData('AddTime');
- return date('Y-m-d H:i:s', $time = substr($addtime, 0, 10));
- }
- public function getAckTimeAttr()
- {
- $addtime = $this->getData('AckTime');
- return date('Y-m-d H:i:s', $time = substr($addtime, 0, 10));
- }
- }
|