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
121 lines
5.1 KiB
PHP
121 lines
5.1 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 crmeb\services;
|
||
|
||
use app\services\system\attachment\SystemAttachmentServices;
|
||
use crmeb\services\wechat\MiniProgram;
|
||
use GuzzleHttp\Psr7\Utils;
|
||
|
||
/**
|
||
* Class QrcodeService
|
||
* @package crmeb\services
|
||
*/
|
||
class QrcodeService
|
||
{
|
||
|
||
/**
|
||
* 获取二维码完整路径,不存在则自动生成
|
||
* @param string $name 路径名
|
||
* @param string $link 需要生成二维码的跳转路径
|
||
* @param int $type https 1 = http , 0 = https
|
||
* @param bool $force 是否返回false
|
||
* @return bool|mixed|string
|
||
*/
|
||
public static function getWechatQrcodePath(string $name, string $link, bool $force = false)
|
||
{
|
||
/** @var SystemAttachmentServices $systemAttchment */
|
||
$systemAttchment = app()->make(SystemAttachmentServices::class);
|
||
try {
|
||
$imageInfo = $systemAttchment->getInfo(['name' => $name]);
|
||
$siteUrl = sys_config('site_url');
|
||
if (!$imageInfo) {
|
||
$codeUrl = UtilService::setHttpType($siteUrl . $link, request()->isSsl() ? 0 : 1);//二维码链接
|
||
$imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
||
if (is_string($imageInfo) && $force)
|
||
return false;
|
||
if (is_array($imageInfo)) {
|
||
$systemAttchment->attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
||
$url = $imageInfo['dir'];
|
||
} else {
|
||
$url = '';
|
||
$imageInfo = ['image_type' => 0];
|
||
}
|
||
} else $url = $imageInfo['att_dir'];
|
||
if ($imageInfo['image_type'] == 1 && $url) $url = $siteUrl . $url;
|
||
return $url;
|
||
} catch (\Throwable $e) {
|
||
if ($force)
|
||
return false;
|
||
else
|
||
return '';
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 获取小程序分享二维码
|
||
* @param int $id
|
||
* @param int $uid
|
||
* @param int $type 1 = 拼团,2 = 秒杀
|
||
* @return bool|string
|
||
*/
|
||
public static function getRoutineQrcodePath(int $id, int $uid, int $type, array $parame = [])
|
||
{
|
||
$page = '';
|
||
$namePath = '';
|
||
$data = 'id=' . $id . '&pid=' . $uid;
|
||
switch ($type) {
|
||
case 1:
|
||
$page = '/pages/activity/goods_details/index?type=3';
|
||
$namePath = 'combination_' . $id . '_' . $uid . '.jpg';
|
||
break;
|
||
case 2:
|
||
$page = '/pages/activity/goods_details/index?type=1';
|
||
$namePath = 'seckill_' . $id . '_' . $uid . '.jpg';
|
||
if (isset($parame['stop_time']) && $parame['stop_time']) {
|
||
$data .= '&time=' . $parame['stop_time'];
|
||
$namePath = $parame['stop_time'] . $namePath;
|
||
}
|
||
break;
|
||
}
|
||
if (!$page || !$namePath) {
|
||
return false;
|
||
}
|
||
/** @var SystemAttachmentServices $systemAttchment */
|
||
$systemAttchment = app()->make(SystemAttachmentServices::class);
|
||
try {
|
||
$imageInfo = $systemAttchment->getInfo($namePath, 'name');
|
||
$siteUrl = sys_config('site_url');
|
||
if (!$imageInfo) {
|
||
$res = MiniProgram::appCodeUnlimit($page, $data, 280);
|
||
if (!$res) return false;
|
||
$uploadType = (int)sys_config('upload_type', 1);
|
||
$upload = UploadService::init($uploadType);
|
||
$res = (string)Utils::streamFor($res);
|
||
$res = $upload->to('routine/product')->validate()->stream($res, $namePath);
|
||
if ($res === false) {
|
||
return false;
|
||
}
|
||
$imageInfo = $upload->getUploadInfo();
|
||
$imageInfo['image_type'] = $uploadType;
|
||
if ($imageInfo['image_type'] == 1) $remoteImage = UtilService::remoteImage($siteUrl . $imageInfo['dir']);
|
||
else $remoteImage = UtilService::remoteImage($imageInfo['dir']);
|
||
if (!$remoteImage['status']) return false;
|
||
$systemAttchment->attachmentAdd($imageInfo['name'], $imageInfo['size'], $imageInfo['type'], $imageInfo['dir'], $imageInfo['thumb_path'], 1, $imageInfo['image_type'], $imageInfo['time'], 2);
|
||
$url = $imageInfo['dir'];
|
||
} else $url = $imageInfo['att_dir'];
|
||
if ($imageInfo['image_type'] == 1) $url = $siteUrl . $url;
|
||
return $url;
|
||
} catch (\Throwable $e) {
|
||
return false;
|
||
}
|
||
}
|
||
}
|