['lang_id', 'type', 'name', 'is_show'], ]; } /** * @notes 设置支持排序字段 * @return array * @author BD * @date 2022/2/9 15:11 */ public function setSortFields(): array { return ['create_time' => 'create_time', 'id' => 'id']; } /** * @notes 设置默认排序 * @return array * @author BD * @date 2022/2/9 15:08 */ public function setDefaultOrder(): array { return ['sort' => 'desc', 'id' => 'desc']; } /** * @notes 获取充值方式列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author BD * @date 2023/11/30 15:22 */ public function lists(): array { return RechargeMethod::where($this->searchWhere) ->append(['lang_name','vip_name']) ->field(['id', 'lang_id', 'type', 'name', 'logo', 'account', 'img', 'bank_name', 'bank_username', 'main_coin_type', 'coin_type', 'protocol', 'address', 'member_id', 'avail_num', 'rate', 'symbol_rate','precision', 'symbol' ,'is_show' ,'is_voucher', 'sort']) ->limit($this->limitOffset, $this->limitLength) ->order($this->sortOrder) ->select() ->toArray(); } /** * @notes 获取充值方式数量 * @return int * @author BD * @date 2023/11/30 15:22 */ public function count(): int { return RechargeMethod::where($this->searchWhere)->count(); } }