Files
huangjingfen/pro_v3.5.1/app/controller/api/pc/User.php
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

77 lines
2.3 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
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace app\controller\api\pc;
use app\Request;
use app\services\user\UserRelationServices;
use app\services\user\UserBrokerageServices;
use app\services\user\UserMoneyServices;
/**
* pc端用户信息类
* Class User
* @package app\controller\api\pc
*/
class User
{
/**
* 用户记录0所有余额1余额消费2余额充值3佣金4提现
* @param Request $request
* @param $type
* @return mixed
*/
public function getBalanceRecord(Request $request, $type)
{
$where = $request->getMore([
['start', 0],
['stop', 0],
['keyword', ''],
]);
$uid = (int)$request->uid();
switch ((int)$type) {
case 0:
case 1:
case 2:
/** @var UserMoneyServices $services */
$services = app()->make(UserMoneyServices::class);
$data = $services->userMoneyList($uid, (int)$type, $where);
break;
case 3:
/** @var UserBrokerageServices $services */
$services = app()->make(UserBrokerageServices::class);
$data = $services->userBrokerageList($uid, $where);
break;
case 4:
/** @var UserBrokerageServices $services */
$services = app()->make(UserBrokerageServices::class);
$data = $services->userExtractList($uid, $where);
break;
default:
$data = [];
}
return app('json')->successful($data);
}
/**
* 获取收藏列表
* @param Request $request
* @param UserRelationServices $services
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getCollectList(Request $request, UserRelationServices $services)
{
$uid = (int)$request->uid();
$list = $services->getUserRelationList($uid);
$count = $services->getUserCount($uid);
return app('json')->successful(compact('list', 'count'));
}
}