'区服ID', 'type' => '类型:1=充值,2=资源', 'key' => 'KEY', 'name' => '道具名称', 'free' => '免费获取', 'pay' => '充值金额或付费获取', 'consume' => '消耗', 'logdate' => '统计日期', ]; } /** * @notes 设置导出文件名 * @return string * @author 段誉 * @date 2021/12/29 10:08 */ public function setFileName(): string { return '财富统计'; } /** * @notes 设置搜索条件 * @return \string[][] * @author likeadmin * @date 2024/04/12 11:05 */ public function setSearch(): array { return [ '=' => ['cid', 'type', 'key'], 'between' => ['logdate'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2024/04/12 11:05 */ public function lists(): array { $reConfig = Resources::column('name', 'key'); $list = LogRichStat::where($this->searchWhere) ->field(['id', 'cid', 'type', 'key', 'free', 'pay', 'consume', 'logdate']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); if ($list) { foreach ($list as $k => $l) { $list[$k]['name'] = isset($reConfig[$l['key']]) ? $reConfig[$l['key']] : ''; } } return $list; } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2024/04/12 11:05 */ public function count(): int { return LogRichStat::where($this->searchWhere)->count(); } }