fix(fsgx): 积分释放定时任务、佣金轮巡与 UniApp 体验

- PointsReleaseServices: 使用 Db::table 查询与更新,构造函数注入 UserDao;日志与账单独立 try/catch\n- SystemTimer: implement_timer 捕获后重新抛出异常,便于 run_now 返回错误\n- SystemTimerServices / 控制器: runNow 返回任务结果并在 API 中带回 result\n- StoreOrderCreateServices: 报单佣金位次修正与多件轮巡\n- UniApp: 佣金记录跳转 type=2、余额提现免手续费展示、状态页与资产页头部渐变与提现页一致\n- docs: 增加 fsgx-issues-0328-1 问题跟踪

Made-with: Cursor
This commit is contained in:
panchengyong
2026-03-29 10:36:52 +08:00
parent 35b6d76d50
commit ac86ec57cf
9 changed files with 141 additions and 102 deletions

View File

@@ -236,15 +236,15 @@ class SystemTimerServices extends BaseServices
/**
* 手动立即执行指定定时任务HTTP 请求上下文,绕过 Swoole Cron 构造,用反射直接调用 implement_timer
* @param string $mark
* @return void
* @return mixed 任务返回值(如 executeRelease 返回的处理统计数组),可为 null
*/
public function runNow(string $mark): void
public function runNow(string $mark): mixed
{
$this->update(['mark' => $mark], ['last_execution_time' => time()]);
try {
$ref = new \ReflectionClass(SystemTimerListener::class);
$instance = $ref->newInstanceWithoutConstructor();
$instance->implement_timer($mark);
return $instance->implement_timer($mark);
} catch (\Throwable $e) {
$taskName = $this->taskName[$mark] ?? $mark;
throw new \RuntimeException("定时任务[{$taskName}]执行失败: " . $e->getMessage(), 0, $e);