Files
huangjingfen/pro_v3.5.1_副本/crmeb/services/wechat/Messages.php
apple 434aa8c69d 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
2026-03-23 22:32:19 +08:00

198 lines
6.6 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
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace crmeb\services\wechat;
use crmeb\services\wechat\message\Article;
use crmeb\services\wechat\message\Image;
use crmeb\services\wechat\message\Media;
use crmeb\services\wechat\message\News;
use crmeb\services\wechat\message\NewsItem;
use crmeb\services\wechat\message\Text;
use crmeb\services\wechat\message\TextCard;
use crmeb\services\wechat\message\Transfer;
use crmeb\services\wechat\message\Video;
use crmeb\services\wechat\message\Voice;
/**
* 消息回复模板
* Class Messages
* @package crmeb\services\wechat
*/
class Messages
{
/**
* 回复文本消息
* @param string $content 文本内容
* @return Text
*/
public static function textMessage(string $content = ''): Text
{
$content = str_replace("\\n", "\n", $content); //返回数据处理换行符
$content = str_replace("\\r", "\r", $content); //返回数据处理换行符
return new Text($content);
}
/**
* 回复图片消息
* @param string $mediaId 媒体资源 ID
* @return Image
*/
public static function imageMessage(string $mediaId): Image
{
return new Image($mediaId);
}
/**
* 回复视频消息
* @param string $mediaId 媒体资源 ID
* @param string $title 标题
* @param string $description 描述
* @param null $thumb_media_id 封面资源 ID
* @return Video
*/
public static function videoMessage(string $mediaId, string $title = '', string $description = '...', $thumb_media_id = null): Video
{
return new Video($mediaId, compact('title', 'description', 'thumb_media_id'));
}
/**
* 回复声音消息
* @param string $mediaId 媒体资源 ID
* @return Voice
*/
public static function voiceMessage(string $mediaId): Voice
{
return new Voice($mediaId);
}
/**
* 回复图文消息
* @param array|string $title
* @param string $description
* @param string $url
* @param string $image
* @return News
*/
public static function newsMessage(array|string $title, string $description = '...', string $url = '', string $image = ''): News
{
if (is_array($title)) {
$items = [
new NewsItem([
'title' => $title['title'],
'description' => $title['description'],
'url' => $title['url'],
'image' => $title['image']
])
];
} else {
$items = [
new NewsItem([
'title' => $title,
'description' => $description,
'url' => $url,
'image' => $image
])
];
}
return new News($items);
}
/**
* 创建新闻消息类型
* @param string|array $title
* @param string $description
* @param string $url
* @param string $image
* @return News
*/
public static function newMessage(string|array $title, string $description = '...', string $url = '', string $image = ''): News
{
if (is_array($title)) {
$items = [
new NewsItem([
'title' => $title['title'],
'description' => $title['description'],
'url' => $title['url'],
'image' => $title['image']
])
];
} else {
$items = [
new NewsItem([
'title' => $title,
'description' => $description,
'url' => $url,
'image' => $image
])
];
}
return new News($items);
}
/**
* 回复文章消息
* @param string|array $title 标题
* @param string $thumb_media_id 图文消息的封面图片素材id必须是永久 media_ID
* @param string $source_url 图文消息的原文地址即点击“阅读原文”后的URL
* @param string $content 图文消息的具体内容支持HTML标签必须少于2万字符小于1M且此处会去除JS
* @param string $author 作者
* @param string $digest 图文消息的摘要,仅有单图文消息才有摘要,多图文此处为空
* @param int $show_cover_pic 是否显示封面0为false即不显示1为true即显示
* @param int $need_open_comment 是否打开评论0不打开1打开
* @param int $only_fans_can_comment 是否粉丝才可评论0所有人可评论1粉丝才可评论
* @return Article
*/
public static function articleMessage(array|string $title, string $thumb_media_id, string $source_url, string $content = '', string $author = '', string $digest = '', int $show_cover_pic = 0, int $need_open_comment = 0, int $only_fans_can_comment = 1): Article
{
$data = is_array($title) ? $title : compact('title', 'thumb_media_id', 'source_url', 'content', 'author', 'digest', 'show_cover_pic', 'need_open_comment', 'only_fans_can_comment');
return new Article($data);
}
/**
* 回复素材消息
* @param string $mediaId
* @param string|null $type mpnews、 mpvideo、voice、image
* @return Media
*/
public static function materialMessage(string $mediaId, string|null $type = null): Media
{
return new Media($mediaId, $type);
}
/**
* 多客服消息转发
* @param string|null $account
* @return Transfer
*/
public static function transfer(string $account = null): Transfer
{
return new Transfer($account);
}
/**
* 消息模板
* @param string $title
* @param string $description
* @param string $url
* @return TextCard
*/
public static function TextCardMessage(string $title, string $description, string $url): TextCard
{
return new TextCard([
'title' => $title,
'description' => $description,
'url' => $url
]);
}
}