Phase1 后端核心:
- 新增 fsgx_v1.sql 迁移脚本(is_queue_goods/frozen_points/available_points/no_assess)
- SystemConfigServices 返佣设置扩展(周期人数/分档比例/范围/时机)
- StoreOrderCreateServices 周期循环佣金计算
- StoreOrderTakeServices 佣金发放后同步冻结积分
- StoreProductServices/StoreProduct 保存 is_queue_goods
Phase2 后端接口:
- GET /api/hjf/brokerage/progress 佣金周期进度
- GET /api/hjf/assets/overview 资产总览
- HjfPointsServices 每日 frozen_points 0.4‰ 释放定时任务
- PUT /adminapi/hjf/member/{uid}/no_assess 不考核接口
- GET /adminapi/hjf/points/release_log 积分日志接口
Phase3 前端清理:
- hjfCustom.js 路由精简(仅保留 points/log)
- hjfQueue.js/hjfMember.js API 清理/重定向至 CRMEB 原生接口
- pages.json 公排→推荐佣金/佣金记录/佣金规则
Phase4-5 前端改造:
- queue/status.vue 推荐佣金进度页整体重写
- 商品详情/订单确认/支付结果页文案与逻辑改造
- 个人中心/资产页/引导页/规则页文案改造
- HjfQueueProgress/HjfRefundNotice/HjfAssetCard 组件改造
- 推广中心嵌入佣金进度摘要
- hjfMockData.js 全量更新(公排字段→佣金字段)
Phase6 Admin 增强:
- 用户列表新增 frozen_points/available_points 列及不考核操作按钮
- hjfPoints.js USE_MOCK=false 对接真实积分日志接口
Phase7 配置文档:
- docs/fsgx-phase7-config-checklist.md 后台配置与全链路验收清单
Made-with: Cursor
161 lines
4.7 KiB
PHP
161 lines
4.7 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
namespace app\controller\api\v1\community;
|
||
|
||
|
||
use app\Request;
|
||
use app\services\community\CommunityServices;
|
||
use app\services\community\CommunityUserServices;
|
||
use think\annotation\Inject;
|
||
use think\db\exception\DataNotFoundException;
|
||
use think\db\exception\DbException;
|
||
use think\db\exception\ModelNotFoundException;
|
||
use think\Response;
|
||
|
||
|
||
/**
|
||
* Class CommunityUser
|
||
* @package app\api\controller\v1\community
|
||
*/
|
||
class CommunityUser
|
||
{
|
||
|
||
/**
|
||
* @var CommunityUserServices
|
||
*/
|
||
#[Inject]
|
||
protected CommunityUserServices $services;
|
||
|
||
/**
|
||
* 用户主页
|
||
* @param $uid
|
||
* @param Request $request
|
||
* @return \think\Response
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
* User: liusl
|
||
* DateTime: 2024/8/22 16:30
|
||
*/
|
||
public function getInfo($authorUid, Request $request)
|
||
{
|
||
$uid = (int)$request->uid();
|
||
return app('json')->success($this->services->getInfo($authorUid, $uid));
|
||
}
|
||
|
||
/**
|
||
* 修改简介
|
||
* @param Request $request
|
||
* @return \think\Response
|
||
* User: liusl
|
||
* DateTime: 2024/8/22 16:30
|
||
*/
|
||
public function updateDesc(Request $request)
|
||
{
|
||
$uid = (int)$request->uid();
|
||
[$desc] = $request->postMore([['desc', '']], true);
|
||
$info = $this->services->getUserInfo($uid);
|
||
if (!$info) {
|
||
return app('json')->fail('用户不存在');
|
||
}
|
||
$info->desc = $desc;
|
||
$info->save();
|
||
return app('json')->success('修改成功');
|
||
}
|
||
|
||
/**
|
||
* 关注/取消关注
|
||
* @param $id
|
||
* @param Request $request
|
||
* @return \think\Response
|
||
* User: liusl
|
||
* DateTime: 2024/8/22 16:31
|
||
*/
|
||
public function setInterest($authorUid, Request $request)
|
||
{
|
||
[$status] = $request->postMore([
|
||
['status', 1]
|
||
], true);
|
||
|
||
$status = $status == 1 ? 1 : 0;
|
||
$uid = (int)$request->uid();
|
||
if ($authorUid == $uid) {
|
||
return app('json')->fail('不能关注自己');
|
||
}
|
||
|
||
$this->services->setInterest($authorUid, $uid, $status);
|
||
if ($status) {
|
||
return app('json')->success('关注成功');
|
||
} else {
|
||
return app('json')->success('取消成功');
|
||
}
|
||
}
|
||
|
||
public function follow(Request $request)
|
||
{
|
||
$uid = (int)$request->uid();
|
||
return app('json')->success($this->services->follow($uid));
|
||
}
|
||
|
||
/**
|
||
* 关注/粉丝列表
|
||
* @param $type 关注:follow 粉丝:fans
|
||
* @param Request $request
|
||
* @return \think\Response
|
||
* @throws \ReflectionException
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
* User: liusl
|
||
* DateTime: 2024/8/26 11:28
|
||
*/
|
||
public function followList($type, Request $request)
|
||
{
|
||
if (!in_array($type, ['follow', 'fans'])) {
|
||
return app('json')->fail('参数错误');
|
||
}
|
||
$uid = (int)$request->uid();
|
||
return app('json')->success($this->services->followList($uid, $type));
|
||
}
|
||
|
||
/**
|
||
* 我的好友
|
||
* @param Request $request
|
||
* @return \think\Response
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
* User: liusl
|
||
* DateTime: 2024/8/26 12:05
|
||
*/
|
||
public function userFriend(Request $request)
|
||
{
|
||
$uid = (int)$request->uid();
|
||
return app('json')->success($this->services->userFriend($uid));
|
||
}
|
||
|
||
/**
|
||
* 推荐
|
||
* @param Request $request
|
||
* @return Response
|
||
* User: liusl
|
||
* DateTime: 2024/8/26 15:18
|
||
* @throws DataNotFoundException
|
||
* @throws DbException
|
||
* @throws ModelNotFoundException
|
||
*/
|
||
public function recommendList(Request $request)
|
||
{
|
||
$uid = (int)$request->uid();
|
||
return app('json')->success($this->services->recommendList($uid));
|
||
}
|
||
}
|