userDao->get($uid, 'uid,now_money,frozen_points,available_points'); if (!$user) { return [ 'now_money' => '0.00', 'frozen_points' => 0, 'available_points' => 0, 'total_points' => 0, ]; } $frozen = (int)($user['frozen_points'] ?? 0); $available = (int)($user['available_points'] ?? 0); return [ 'now_money' => number_format((float)($user['now_money'] ?? 0), 2, '.', ''), 'frozen_points' => $frozen, 'available_points' => $available, 'total_points' => $frozen + $available, ]; } /** * 获取现金流水(分页) * * 复用 eb_user_bill 表,筛选 category='now_money' 的记录。 * * @param int $uid * @param string $type 流水类型筛选('' = 全部,'queue_refund' 公排退款,'withdraw' 提现等) * @param int $page * @param int $limit * @return array */ public function getCashDetail(int $uid, string $type, int $page, int $limit): array { $where = [ 'uid' => $uid, 'category' => 'now_money', ]; if ($type !== '') { $where['type'] = $type; } $count = $this->billDao->count($where); $list = $this->billDao->getBalanceRecord($where, $page, $limit); return compact('list', 'count'); } }