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:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\notification\sms;
|
||||
|
||||
use app\controller\admin\AuthController;
|
||||
use app\services\message\sms\SmsAdminServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 短信账号
|
||||
* Class SmsAdmin
|
||||
* @package app\controller\admin\v1\sms
|
||||
*/
|
||||
class SmsAdmin extends AuthController
|
||||
{
|
||||
/**
|
||||
* 构造方法
|
||||
* SmsAdmin constructor.
|
||||
* @param App $app
|
||||
* @param SmsAdminServices $services
|
||||
*/
|
||||
public function __construct(App $app, SmsAdminServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @return mixed
|
||||
*/
|
||||
public function captcha()
|
||||
{
|
||||
if (!request()->isPost()) {
|
||||
return $this->fail('发送失败');
|
||||
}
|
||||
$phone = request()->param('phone');
|
||||
if (!trim($phone)) {
|
||||
return $this->fail('请填写手机号');
|
||||
}
|
||||
return $this->success($this->services->captcha($phone));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改/注册短信平台账号
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
[$account, $password, $phone, $code, $url, $sign] = $this->request->postMore([
|
||||
['account', ''],
|
||||
['password', ''],
|
||||
['phone', ''],
|
||||
['code', ''],
|
||||
['url', ''],
|
||||
['sign', ''],
|
||||
], true);
|
||||
$signLen = mb_strlen(trim($sign));
|
||||
if (!strlen(trim($account))) return $this->fail('请填写账号');
|
||||
if (!strlen(trim($password))) return $this->fail('请填写密码');
|
||||
if (!$signLen) return $this->fail('请填写短信签名');
|
||||
if ($signLen > 8) return $this->fail('短信签名最长为8位');
|
||||
if (!strlen(trim($code))) return $this->fail('请填写验证码');
|
||||
if (!strlen(trim($url))) return $this->fail('请填写域名');
|
||||
$status = $this->services->register($account, $password, $url, $phone, $code, $sign);
|
||||
return $this->success('短信平台:' . $status['msg']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\notification\sms;
|
||||
|
||||
use think\annotation\Inject;
|
||||
use app\services\message\sms\SmsAdminServices;
|
||||
use app\services\serve\ServeServices;
|
||||
use crmeb\services\CacheService;
|
||||
use app\controller\admin\AuthController;
|
||||
use crmeb\services\SystemConfigService;
|
||||
|
||||
/**
|
||||
* 短信配置
|
||||
* Class SmsConfig
|
||||
* @package app\admin\controller\sms
|
||||
*/
|
||||
class SmsConfig extends AuthController
|
||||
{
|
||||
|
||||
/**
|
||||
* @var SmsAdminServices
|
||||
*/
|
||||
#[Inject]
|
||||
protected SmsAdminServices $services;
|
||||
|
||||
|
||||
/**
|
||||
* 保存短信配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function save_basics()
|
||||
{
|
||||
[$account, $token] = $this->request->postMore([
|
||||
['sms_account', ''],
|
||||
['sms_token', '']
|
||||
], true);
|
||||
|
||||
$this->validate(['sms_account' => $account, 'sms_token' => $token], \app\validate\admin\notification\SmsConfigValidate::class);
|
||||
if(sys_config('sms_account') && sys_config('sms_token')){
|
||||
return $this->success('保存成功');
|
||||
}
|
||||
if ($this->services->updateSmsConfig($account, $token)) {
|
||||
return $this->success('保存成功');
|
||||
} else {
|
||||
return $this->fail('保存失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\notification\sms;
|
||||
|
||||
use crmeb\exceptions\AdminException;
|
||||
use app\controller\admin\AuthController;
|
||||
use crmeb\services\{sms\Sms, SystemConfigService};
|
||||
|
||||
/**
|
||||
* 短信购买
|
||||
* Class SmsPay
|
||||
* @package app\controller\admin\v1\notification\sms
|
||||
*/
|
||||
class SmsPay extends AuthController
|
||||
{
|
||||
/**
|
||||
* @var Sms
|
||||
*/
|
||||
protected $smsHandle;
|
||||
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
$data = SystemConfigService::more(['sms_account', 'sms_token', 'site_url']);
|
||||
$this->smsHandle = new Sms('yunxin', $data);
|
||||
if (!$this->smsHandle->isLogin()) {
|
||||
return $this->fail('请先填写短息配置');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账号信息
|
||||
*/
|
||||
public function number()
|
||||
{
|
||||
$countInfo = $this->smsHandle->count();
|
||||
if ($countInfo['status'] == 400) return $this->fail($countInfo['msg']);
|
||||
$info['account'] = sys_config('sms_account');
|
||||
$info['number'] = $countInfo['data']['number'];
|
||||
$info['send_total'] = $countInfo['data']['send_total'];
|
||||
return $this->success($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付套餐
|
||||
*/
|
||||
public function price()
|
||||
{
|
||||
[$page, $limit] = $this->request->getMore([
|
||||
['page', 1],
|
||||
['limit', 20],
|
||||
], true);
|
||||
$mealInfo = $this->smsHandle->meal($page, $limit);
|
||||
if ($mealInfo['status'] == 400) return $this->fail($mealInfo['msg']);
|
||||
return $this->success($mealInfo['data']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付码
|
||||
*/
|
||||
public function pay()
|
||||
{
|
||||
[$payType, $mealId, $price] = $this->request->postMore([
|
||||
['payType', 'weixin'],
|
||||
['mealId', 0],
|
||||
['price', 0],
|
||||
], true);
|
||||
$payInfo = $this->smsHandle->pay($payType, $mealId, $price, $this->adminId);
|
||||
if ($payInfo['status'] == 400) return $this->fail($payInfo['msg']);
|
||||
return $this->success($payInfo['data']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\notification\sms;
|
||||
|
||||
use app\controller\admin\AuthController;
|
||||
use crmeb\exceptions\AdminException;
|
||||
use crmeb\services\sms\Sms;
|
||||
use crmeb\services\SystemConfigService;
|
||||
|
||||
/**
|
||||
* 公共短信模板
|
||||
* Class SmsPublicTemp
|
||||
* @package app\controller\admin\v1\notification\sms
|
||||
*/
|
||||
class SmsPublicTemp extends AuthController
|
||||
{
|
||||
/**
|
||||
* @var Sms
|
||||
*/
|
||||
protected $smsHandle;
|
||||
|
||||
/**
|
||||
* 初始化短信配置
|
||||
* @return void
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
$data = SystemConfigService::more(['sms_account', 'sms_token', 'site_url']);
|
||||
$this->smsHandle = new Sms('yunxin', $data);
|
||||
if (!$this->smsHandle->isLogin()) {
|
||||
return $this->fail('请先填写短息配置');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步获取公共模板列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
['is_have', ''],
|
||||
['page', 1],
|
||||
['limit', 20],
|
||||
]);
|
||||
$templateList = $this->smsHandle->publictemp($where);
|
||||
if ($templateList['status'] == 400) return $this->fail($templateList['msg']);
|
||||
$arr = $templateList['data']['data'];
|
||||
foreach ($arr as $key => $value) {
|
||||
switch ($value['type']) {
|
||||
case 1:
|
||||
$arr[$key]['type'] = '验证码';
|
||||
break;
|
||||
case 2:
|
||||
$arr[$key]['type'] = '通知';
|
||||
break;
|
||||
case 3:
|
||||
$arr[$key]['type'] = '推广';
|
||||
break;
|
||||
default:
|
||||
$arr[$key]['type'] = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
$templateList['data']['data'] = $arr;
|
||||
return $this->success($templateList['data']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\admin\v1\notification\sms;
|
||||
|
||||
use app\controller\admin\AuthController;
|
||||
use app\services\serve\ServeServices;
|
||||
use think\facade\App;
|
||||
|
||||
/**
|
||||
* 短信模板申请
|
||||
* Class SmsTemplateApply
|
||||
* @package app\controller\admin\v1\notification\sms
|
||||
*/
|
||||
class SmsTemplateApply extends AuthController
|
||||
{
|
||||
|
||||
public function __construct(App $app, ServeServices $services)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->services = $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步获取模板列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$where = $this->request->getMore([
|
||||
[['type', 'd'], 0],
|
||||
['status', ''],
|
||||
['title', ''],
|
||||
[['page', 'd'], 1],
|
||||
[['limit', 'd'], 20],
|
||||
]);
|
||||
$where['temp_type'] = $where['type'];
|
||||
$templateList = $this->services->sms()->temps($where['page'], $where['limit'], $where['type']);
|
||||
$templateList['data'] = $templateList['data'] ?? [];
|
||||
foreach ($templateList['data'] as $key => &$item) {
|
||||
$item['templateid'] = $item['temp_id'];
|
||||
switch ((int)$item['temp_type']) {
|
||||
case 1:
|
||||
$item['type'] = '验证码';
|
||||
break;
|
||||
case 2:
|
||||
$item['type'] = '通知';
|
||||
break;
|
||||
case 30:
|
||||
$item['type'] = '营销短信';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $this->success($templateList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return string
|
||||
* @throws \FormBuilder\Exception\FormBuilderException
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return $this->success($this->services->getSmsTemplateForm());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$data = $this->request->postMore([
|
||||
['title', ''],
|
||||
['content', ''],
|
||||
['type', 0]
|
||||
]);
|
||||
if (!strlen(trim($data['title']))) {
|
||||
return $this->fail('请输入模板名称');
|
||||
}
|
||||
if (!strlen(trim($data['content']))) {
|
||||
return $this->fail('请输入模板内容');
|
||||
}
|
||||
$this->services->sms()->apply($data['title'], $data['content'], $data['type']);
|
||||
return $this->success('申请成功');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user