Files
huangjingfen/pro_v3.5.1/app/controller/api/v1/hjf/PointsController.php
apple 78de918c37 Initial commit: queue workspace
Made-with: Cursor
2026-03-21 02:55:24 +08:00

50 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace app\controller\api\v1\hjf;
use app\Request;
use app\dao\hjf\PointsReleaseLogDao;
use think\annotation\Inject;
/**
* 用户端 · 积分明细接口
*
* GET /api/hjf/points/detail — 积分明细分页支持5种类型筛选
*
* Class PointsController
* @package app\controller\api\v1\hjf
*/
class PointsController
{
#[Inject]
protected PointsReleaseLogDao $dao;
/**
* 积分明细(分页)
*
* 查询参数:
* - type: '' | reward_direct | reward_umbrella | release | consume
* - page, limit
*
* @param Request $request
* @return mixed
*/
public function detail(Request $request): mixed
{
$uid = (int)$request->uid();
$type = (string)$request->param('type', '');
$page = max(1, (int)$request->param('page', 1));
$limit = min(50, max(1, (int)$request->param('limit', 15)));
$validTypes = ['', 'reward_direct', 'reward_umbrella', 'release', 'consume'];
if (!in_array($type, $validTypes, true)) {
$type = '';
}
return app('json')->success(
$this->dao->getDetailList($uid, $type, $page, $limit)
);
}
}