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
160 lines
3.8 KiB
PHP
160 lines
3.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace GuzzleHttp\Psr7;
|
|
|
|
use InvalidArgumentException;
|
|
use Psr\Http\Message\RequestInterface;
|
|
use Psr\Http\Message\StreamInterface;
|
|
use Psr\Http\Message\UriInterface;
|
|
|
|
/**
|
|
* PSR-7 request implementation.
|
|
*/
|
|
class Request implements RequestInterface
|
|
{
|
|
use MessageTrait;
|
|
|
|
/** @var string */
|
|
private $method;
|
|
|
|
/** @var string|null */
|
|
private $requestTarget;
|
|
|
|
/** @var UriInterface */
|
|
private $uri;
|
|
|
|
/**
|
|
* @param string $method HTTP method
|
|
* @param string|UriInterface $uri URI
|
|
* @param array<string, string|string[]> $headers Request headers
|
|
* @param string|resource|StreamInterface|null $body Request body
|
|
* @param string $version Protocol version
|
|
*/
|
|
public function __construct(
|
|
string $method,
|
|
$uri,
|
|
array $headers = [],
|
|
$body = null,
|
|
string $version = '1.1'
|
|
) {
|
|
$this->assertMethod($method);
|
|
if (!($uri instanceof UriInterface)) {
|
|
$uri = new Uri($uri);
|
|
}
|
|
|
|
$this->method = strtoupper($method);
|
|
$this->uri = $uri;
|
|
$this->setHeaders($headers);
|
|
$this->protocol = $version;
|
|
|
|
if (!isset($this->headerNames['host'])) {
|
|
$this->updateHostFromUri();
|
|
}
|
|
|
|
if ($body !== '' && $body !== null) {
|
|
$this->stream = Utils::streamFor($body);
|
|
}
|
|
}
|
|
|
|
public function getRequestTarget(): string
|
|
{
|
|
if ($this->requestTarget !== null) {
|
|
return $this->requestTarget;
|
|
}
|
|
|
|
$target = $this->uri->getPath();
|
|
if ($target === '') {
|
|
$target = '/';
|
|
}
|
|
if ($this->uri->getQuery() != '') {
|
|
$target .= '?'.$this->uri->getQuery();
|
|
}
|
|
|
|
return $target;
|
|
}
|
|
|
|
public function withRequestTarget($requestTarget): RequestInterface
|
|
{
|
|
if (preg_match('#\s#', $requestTarget)) {
|
|
throw new InvalidArgumentException(
|
|
'Invalid request target provided; cannot contain whitespace'
|
|
);
|
|
}
|
|
|
|
$new = clone $this;
|
|
$new->requestTarget = $requestTarget;
|
|
|
|
return $new;
|
|
}
|
|
|
|
public function getMethod(): string
|
|
{
|
|
return $this->method;
|
|
}
|
|
|
|
public function withMethod($method): RequestInterface
|
|
{
|
|
$this->assertMethod($method);
|
|
$new = clone $this;
|
|
$new->method = strtoupper($method);
|
|
|
|
return $new;
|
|
}
|
|
|
|
public function getUri(): UriInterface
|
|
{
|
|
return $this->uri;
|
|
}
|
|
|
|
public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
|
|
{
|
|
if ($uri === $this->uri) {
|
|
return $this;
|
|
}
|
|
|
|
$new = clone $this;
|
|
$new->uri = $uri;
|
|
|
|
if (!$preserveHost || !isset($this->headerNames['host'])) {
|
|
$new->updateHostFromUri();
|
|
}
|
|
|
|
return $new;
|
|
}
|
|
|
|
private function updateHostFromUri(): void
|
|
{
|
|
$host = $this->uri->getHost();
|
|
|
|
if ($host == '') {
|
|
return;
|
|
}
|
|
|
|
if (($port = $this->uri->getPort()) !== null) {
|
|
$host .= ':'.$port;
|
|
}
|
|
|
|
if (isset($this->headerNames['host'])) {
|
|
$header = $this->headerNames['host'];
|
|
} else {
|
|
$header = 'Host';
|
|
$this->headerNames['host'] = 'Host';
|
|
}
|
|
// Ensure Host is the first header.
|
|
// See: http://tools.ietf.org/html/rfc7230#section-5.4
|
|
$this->headers = [$header => [$host]] + $this->headers;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $method
|
|
*/
|
|
private function assertMethod($method): void
|
|
{
|
|
if (!is_string($method) || $method === '') {
|
|
throw new InvalidArgumentException('Method must be a non-empty string.');
|
|
}
|
|
}
|
|
}
|