Files
fastmovieai/fastmovie-admin/plugin/user/app/api/controller/BillController.php
T
李建琦 eae151fd57 FastMovieAI AI短剧创作平台 二开基线
- 源码: xhadmincn/FastMovieAI (Apache 2.0)
- 二开: Docker部署, Swoole改Select, route.php修复, 补update/VERSION
- vendor/示例资源已gitignore
2026-08-26 18:37:36 +08:00

37 lines
1.1 KiB
PHP

<?php
namespace plugin\user\app\api\controller;
use app\Basic;
use plugin\finance\utils\enum\PointsBillScene;
use plugin\user\app\model\PluginUserPointsBill;
use plugin\user\utils\enum\MoneyAction;
use support\Request;
class BillController extends Basic
{
public function getPointsBill(Request $request)
{
$type = $request->get('type', 'all');
$uid = $request->uid;
$limit = $request->get('limit', 10);
$where = [];
$where[] = ['uid', '=', $uid];
if ($type != 'all') {
if ($type == 'consume') {
$where[] = ['action', '=', MoneyAction::DECREASE['value']];
}
if ($type == 'gain') {
$where[] = ['action', '=', MoneyAction::INCREASE['value']];
}
if ($type == 'recharge') {
$where[] = ['scene', '=', PointsBillScene::RECHARGE['value']];
}
}
$PluginFinanceBill = PluginUserPointsBill::where($where)->order('create_time', 'desc')->paginate($limit);
return $this->resData($PluginFinanceBill);
}
}