'兑换码类型', 'code' => '兑换码', 'batch' => '批次', 'endtime' => '截止时间', 'rewards' => '奖励', 'uid' => '绑定用户', 'status' => '状态', 'createtime' => '创建时间', ]; } /** * @notes 设置导出文件名 * @return string * @author 段誉 * @date 2021/12/29 10:08 */ public function setFileName(): string { return '兑换码表'; } /** * @notes 设置搜索条件 * @return \string[][] * @author likeadmin * @date 2024/03/29 09:40 */ public function setSearch(): array { return [ '=' => ['type', 'code', 'batch', 'uid', 'status'], 'between' => ['createtime'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/03/29 09:40 */ public function lists(): array { return Redeems::where($this->searchWhere) ->field(['id', 'type', 'code', 'batch', 'endtime', 'rewards', 'uid', 'status', 'createtime']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2024/03/29 09:40 */ public function count(): int { return Redeems::where($this->searchWhere)->count(); } }