feat(fsgx): 完成全部24项开发任务 Phase1-7
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
This commit is contained in:
299
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/dql-parser.rst
vendored
Normal file
299
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/dql-parser.rst
vendored
Normal file
@@ -0,0 +1,299 @@
|
||||
DQL Lexer
|
||||
=========
|
||||
|
||||
Here is a more complicated example from the Doctrine ORM project.
|
||||
The ``Doctrine\ORM\Query\Lexer`` implementation for DQL looks something
|
||||
like the following:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
use Doctrine\Common\Lexer\AbstractLexer;
|
||||
|
||||
class Lexer extends AbstractLexer
|
||||
{
|
||||
// All tokens that are not valid identifiers must be < 100
|
||||
public const T_NONE = 1;
|
||||
public const T_INTEGER = 2;
|
||||
public const T_STRING = 3;
|
||||
public const T_INPUT_PARAMETER = 4;
|
||||
public const T_FLOAT = 5;
|
||||
public const T_CLOSE_PARENTHESIS = 6;
|
||||
public const T_OPEN_PARENTHESIS = 7;
|
||||
public const T_COMMA = 8;
|
||||
public const T_DIVIDE = 9;
|
||||
public const T_DOT = 10;
|
||||
public const T_EQUALS = 11;
|
||||
public const T_GREATER_THAN = 12;
|
||||
public const T_LOWER_THAN = 13;
|
||||
public const T_MINUS = 14;
|
||||
public const T_MULTIPLY = 15;
|
||||
public const T_NEGATE = 16;
|
||||
public const T_PLUS = 17;
|
||||
public const T_OPEN_CURLY_BRACE = 18;
|
||||
public const T_CLOSE_CURLY_BRACE = 19;
|
||||
|
||||
// All tokens that are identifiers or keywords that could be considered as identifiers should be >= 100
|
||||
public const T_ALIASED_NAME = 100;
|
||||
public const T_FULLY_QUALIFIED_NAME = 101;
|
||||
public const T_IDENTIFIER = 102;
|
||||
|
||||
// All keyword tokens should be >= 200
|
||||
public const T_ALL = 200;
|
||||
public const T_AND = 201;
|
||||
public const T_ANY = 202;
|
||||
public const T_AS = 203;
|
||||
public const T_ASC = 204;
|
||||
public const T_AVG = 205;
|
||||
public const T_BETWEEN = 206;
|
||||
public const T_BOTH = 207;
|
||||
public const T_BY = 208;
|
||||
public const T_CASE = 209;
|
||||
public const T_COALESCE = 210;
|
||||
public const T_COUNT = 211;
|
||||
public const T_DELETE = 212;
|
||||
public const T_DESC = 213;
|
||||
public const T_DISTINCT = 214;
|
||||
public const T_ELSE = 215;
|
||||
public const T_EMPTY = 216;
|
||||
public const T_END = 217;
|
||||
public const T_ESCAPE = 218;
|
||||
public const T_EXISTS = 219;
|
||||
public const T_FALSE = 220;
|
||||
public const T_FROM = 221;
|
||||
public const T_GROUP = 222;
|
||||
public const T_HAVING = 223;
|
||||
public const T_HIDDEN = 224;
|
||||
public const T_IN = 225;
|
||||
public const T_INDEX = 226;
|
||||
public const T_INNER = 227;
|
||||
public const T_INSTANCE = 228;
|
||||
public const T_IS = 229;
|
||||
public const T_JOIN = 230;
|
||||
public const T_LEADING = 231;
|
||||
public const T_LEFT = 232;
|
||||
public const T_LIKE = 233;
|
||||
public const T_MAX = 234;
|
||||
public const T_MEMBER = 235;
|
||||
public const T_MIN = 236;
|
||||
public const T_NEW = 237;
|
||||
public const T_NOT = 238;
|
||||
public const T_NULL = 239;
|
||||
public const T_NULLIF = 240;
|
||||
public const T_OF = 241;
|
||||
public const T_OR = 242;
|
||||
public const T_ORDER = 243;
|
||||
public const T_OUTER = 244;
|
||||
public const T_PARTIAL = 245;
|
||||
public const T_SELECT = 246;
|
||||
public const T_SET = 247;
|
||||
public const T_SOME = 248;
|
||||
public const T_SUM = 249;
|
||||
public const T_THEN = 250;
|
||||
public const T_TRAILING = 251;
|
||||
public const T_TRUE = 252;
|
||||
public const T_UPDATE = 253;
|
||||
public const T_WHEN = 254;
|
||||
public const T_WHERE = 255;
|
||||
public const T_WITH = 256;
|
||||
|
||||
/**
|
||||
* Creates a new query scanner object.
|
||||
*
|
||||
* @param string $input A query string.
|
||||
*/
|
||||
public function __construct(string $input)
|
||||
{
|
||||
$this->setInput($input);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getCatchablePatterns(): array
|
||||
{
|
||||
return [
|
||||
'[a-z_][a-z0-9_]*\:[a-z_][a-z0-9_]*(?:\\\[a-z_][a-z0-9_]*)*', // aliased name
|
||||
'[a-z_\\\][a-z0-9_]*(?:\\\[a-z_][a-z0-9_]*)*', // identifier or qualified name
|
||||
'(?:[0-9]+(?:[\.][0-9]+)*)(?:e[+-]?[0-9]+)?', // numbers
|
||||
"'(?:[^']|'')*'", // quoted strings
|
||||
'\?[0-9]*|:[a-z_][a-z0-9_]*', // parameters
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getNonCatchablePatterns(): array
|
||||
{
|
||||
return ['\s+', '(.)'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getType(&$value): int
|
||||
{
|
||||
$type = self::T_NONE;
|
||||
|
||||
switch (true) {
|
||||
// Recognize numeric values
|
||||
case (is_numeric($value)):
|
||||
if (strpos($value, '.') !== false || stripos($value, 'e') !== false) {
|
||||
return self::T_FLOAT;
|
||||
}
|
||||
|
||||
return self::T_INTEGER;
|
||||
|
||||
// Recognize quoted strings
|
||||
case ($value[0] === "'"):
|
||||
$value = str_replace("''", "'", substr($value, 1, strlen($value) - 2));
|
||||
|
||||
return self::T_STRING;
|
||||
|
||||
// Recognize identifiers, aliased or qualified names
|
||||
case (ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\'):
|
||||
$name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value);
|
||||
|
||||
if (defined($name)) {
|
||||
$type = constant($name);
|
||||
|
||||
if ($type > 100) {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
if (strpos($value, ':') !== false) {
|
||||
return self::T_ALIASED_NAME;
|
||||
}
|
||||
|
||||
if (strpos($value, '\\') !== false) {
|
||||
return self::T_FULLY_QUALIFIED_NAME;
|
||||
}
|
||||
|
||||
return self::T_IDENTIFIER;
|
||||
|
||||
// Recognize input parameters
|
||||
case ($value[0] === '?' || $value[0] === ':'):
|
||||
return self::T_INPUT_PARAMETER;
|
||||
|
||||
// Recognize symbols
|
||||
case ($value === '.'):
|
||||
return self::T_DOT;
|
||||
case ($value === ','):
|
||||
return self::T_COMMA;
|
||||
case ($value === '('):
|
||||
return self::T_OPEN_PARENTHESIS;
|
||||
case ($value === ')'):
|
||||
return self::T_CLOSE_PARENTHESIS;
|
||||
case ($value === '='):
|
||||
return self::T_EQUALS;
|
||||
case ($value === '>'):
|
||||
return self::T_GREATER_THAN;
|
||||
case ($value === '<'):
|
||||
return self::T_LOWER_THAN;
|
||||
case ($value === '+'):
|
||||
return self::T_PLUS;
|
||||
case ($value === '-'):
|
||||
return self::T_MINUS;
|
||||
case ($value === '*'):
|
||||
return self::T_MULTIPLY;
|
||||
case ($value === '/'):
|
||||
return self::T_DIVIDE;
|
||||
case ($value === '!'):
|
||||
return self::T_NEGATE;
|
||||
case ($value === '{'):
|
||||
return self::T_OPEN_CURLY_BRACE;
|
||||
case ($value === '}'):
|
||||
return self::T_CLOSE_CURLY_BRACE;
|
||||
|
||||
// Default
|
||||
default:
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
This is roughly what the DQL Parser looks like that uses the above
|
||||
Lexer implementation:
|
||||
|
||||
.. note::
|
||||
|
||||
You can see the full implementation `here <https://github.com/doctrine/doctrine2/blob/1.3.x/lib/Doctrine/ORM/Query/Parser.php>`_.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
class Parser
|
||||
{
|
||||
private $lexer;
|
||||
|
||||
public function __construct(string $dql)
|
||||
{
|
||||
$this->lexer = new Lexer();
|
||||
$this->lexer->setInput($dql);
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
public function getAST(): AST\SelectStatement|AST\UpdateStatement|AST\DeleteStatement
|
||||
{
|
||||
// Parse & build AST
|
||||
$AST = $this->QueryLanguage();
|
||||
|
||||
// ...
|
||||
|
||||
return $AST;
|
||||
}
|
||||
|
||||
public function QueryLanguage(): AST\SelectStatement|AST\UpdateStatement|AST\DeleteStatement
|
||||
{
|
||||
$this->lexer->moveNext();
|
||||
|
||||
switch ($this->lexer->lookahead->type) {
|
||||
case Lexer::T_SELECT:
|
||||
$statement = $this->SelectStatement();
|
||||
break;
|
||||
case Lexer::T_UPDATE:
|
||||
$statement = $this->UpdateStatement();
|
||||
break;
|
||||
case Lexer::T_DELETE:
|
||||
$statement = $this->DeleteStatement();
|
||||
break;
|
||||
default:
|
||||
$this->syntaxError('SELECT, UPDATE or DELETE');
|
||||
}
|
||||
|
||||
// Check for end of string
|
||||
if ($this->lexer->lookahead !== null) {
|
||||
$this->syntaxError('end of string');
|
||||
}
|
||||
|
||||
return $statement;
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
Now the AST is used to transform the DQL query in to portable SQL for whatever relational
|
||||
database you are using!
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
$parser = new Parser('SELECT u FROM User u');
|
||||
$AST = $parser->getAST(); // returns \Doctrine\ORM\Query\AST\SelectStatement
|
||||
|
||||
What is an AST?
|
||||
===============
|
||||
|
||||
AST stands for `Abstract syntax tree <http://en.wikipedia.org/wiki/Abstract_syntax_tree>`_.
|
||||
In computer science, an abstract syntax tree (AST), or just syntax tree, is a
|
||||
tree representation of the abstract syntactic structure of source code written
|
||||
in a programming language. Each node of the tree denotes a construct occurring in
|
||||
the source code.
|
||||
48
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/index.rst
vendored
Normal file
48
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/index.rst
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
Introduction
|
||||
============
|
||||
|
||||
Doctrine Lexer is a library that can be used in Top-Down, Recursive
|
||||
Descent Parsers. This lexer is used in Doctrine Annotations and in
|
||||
Doctrine ORM (DQL).
|
||||
|
||||
To write your own parser you just need to extend ``Doctrine\Common\Lexer\AbstractLexer``
|
||||
and implement the following three abstract methods.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
/**
|
||||
* Lexical catchable patterns.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
abstract protected function getCatchablePatterns();
|
||||
|
||||
/**
|
||||
* Lexical non-catchable patterns.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
abstract protected function getNonCatchablePatterns();
|
||||
|
||||
/** Retrieve token type. Also processes the token value if necessary. */
|
||||
abstract protected function getType(string &$value): int;
|
||||
|
||||
These methods define the `lexical <http://en.wikipedia.org/wiki/Lexical_analysis>`_
|
||||
catchable and non-catchable patterns and a method for returning the
|
||||
type of a token and filtering the value if necessary.
|
||||
|
||||
The Lexer is responsible for giving you an API to walk across a
|
||||
string one character at a time and analyze the type of each character, value and position of
|
||||
each token in the string. The low level API of the lexer is pretty simple:
|
||||
|
||||
- ``setInput($input)`` - Sets the input data to be tokenized. The Lexer is immediately reset and the new input tokenized.
|
||||
- ``reset()`` - Resets the lexer.
|
||||
- ``resetPeek()`` - Resets the peek pointer to 0.
|
||||
- ``resetPosition($position = 0)`` - Resets the lexer position on the input to the given position.
|
||||
- ``isNextToken($token)`` - Checks whether a given token matches the current lookahead.
|
||||
- ``isNextTokenAny(array $tokens)`` - Checks whether any of the given tokens matches the current lookahead.
|
||||
- ``moveNext()`` - Moves to the next token in the input string.
|
||||
- ``skipUntil($type)`` - Tells the lexer to skip input tokens until it sees a token with the given value.
|
||||
- ``isA($value, $token)`` - Checks if given value is identical to the given token.
|
||||
- ``peek()`` - Moves the lookahead token forward.
|
||||
- ``glimpse()`` - Peeks at the next token, returns it and immediately resets the peek.
|
||||
6
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/sidebar.rst
vendored
Normal file
6
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/sidebar.rst
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.. toctree::
|
||||
:depth: 3
|
||||
|
||||
index
|
||||
simple-parser-example
|
||||
dql-parser
|
||||
103
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/simple-parser-example.rst
vendored
Normal file
103
pro_v3.5.1_副本/vendor/doctrine/lexer/docs/en/simple-parser-example.rst
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
Simple Parser Example
|
||||
=====================
|
||||
|
||||
Extend the ``Doctrine\Common\Lexer\AbstractLexer`` class and implement
|
||||
the ``getCatchablePatterns``, ``getNonCatchablePatterns``, and ``getType``
|
||||
methods. Here is a very simple example lexer implementation named ``CharacterTypeLexer``.
|
||||
It tokenizes a string to ``T_UPPER``, ``T_LOWER`` and``T_NUMBER`` tokens:
|
||||
|
||||
.. code-block:: php
|
||||
<?php
|
||||
|
||||
use Doctrine\Common\Lexer\AbstractLexer;
|
||||
|
||||
/**
|
||||
* @extends AbstractLexer<CharacterTypeLexer::T_*, string>
|
||||
*/
|
||||
class CharacterTypeLexer extends AbstractLexer
|
||||
{
|
||||
const T_UPPER = 1;
|
||||
const T_LOWER = 2;
|
||||
const T_NUMBER = 3;
|
||||
|
||||
protected function getCatchablePatterns(): array
|
||||
{
|
||||
return [
|
||||
'[a-bA-Z0-9]',
|
||||
];
|
||||
}
|
||||
|
||||
protected function getNonCatchablePatterns(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
protected function getType(&$value): int
|
||||
{
|
||||
if (is_numeric($value)) {
|
||||
return self::T_NUMBER;
|
||||
}
|
||||
|
||||
if (strtoupper($value) === $value) {
|
||||
return self::T_UPPER;
|
||||
}
|
||||
|
||||
if (strtolower($value) === $value) {
|
||||
return self::T_LOWER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Use ``CharacterTypeLexer`` to extract an array of upper case characters:
|
||||
|
||||
.. code-block:: php
|
||||
<?php
|
||||
|
||||
class UpperCaseCharacterExtracter
|
||||
{
|
||||
public function __construct(private CharacterTypeLexer $lexer)
|
||||
{
|
||||
}
|
||||
|
||||
/** @return list<string> */
|
||||
public function getUpperCaseCharacters(string $string): array
|
||||
{
|
||||
$this->lexer->setInput($string);
|
||||
$this->lexer->moveNext();
|
||||
|
||||
$upperCaseChars = [];
|
||||
while (true) {
|
||||
if (!$this->lexer->lookahead) {
|
||||
break;
|
||||
}
|
||||
|
||||
$this->lexer->moveNext();
|
||||
|
||||
if ($this->lexer->token->isA(CharacterTypeLexer::T_UPPER)) {
|
||||
$upperCaseChars[] = $this->lexer->token->value;
|
||||
}
|
||||
}
|
||||
|
||||
return $upperCaseChars;
|
||||
}
|
||||
}
|
||||
|
||||
$upperCaseCharacterExtractor = new UpperCaseCharacterExtracter(new CharacterTypeLexer());
|
||||
$upperCaseCharacters = $upperCaseCharacterExtractor->getUpperCaseCharacters('1aBcdEfgHiJ12');
|
||||
|
||||
print_r($upperCaseCharacters);
|
||||
|
||||
The variable ``$upperCaseCharacters`` contains all of the upper case
|
||||
characters:
|
||||
|
||||
.. code-block:: php
|
||||
Array
|
||||
(
|
||||
[0] => B
|
||||
[1] => E
|
||||
[2] => H
|
||||
[3] => J
|
||||
)
|
||||
|
||||
This is a simple example but it should demonstrate the low level API
|
||||
that can be used to build more complex parsers.
|
||||
Reference in New Issue
Block a user