where([ 'user_id' => $this->userId, 'pay_status' => PayEnum::ISPAID ]) ->order('id', 'desc') ->select() ->toArray(); foreach($lists as &$item) { $item['tips'] = '充值' . format_amount($item['order_amount']) . '元'; } return $lists; } /** * @notes 获取数量 * @return int * @author 段誉 * @date 2023/2/23 18:43 */ public function count(): int { return RechargeOrder::where([ 'user_id' => $this->userId, 'pay_status' => PayEnum::ISPAID ]) ->count(); } }