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
141 lines
5.4 KiB
PHP
141 lines
5.4 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 app\services\system\config;
|
||
|
||
|
||
use app\dao\system\config\SystemConfigTabDao;
|
||
use app\services\BaseServices;
|
||
use crmeb\exceptions\AdminException;
|
||
use crmeb\services\FormBuilder as Form;
|
||
use think\annotation\Inject;
|
||
|
||
/**
|
||
* 系统配置分类
|
||
* Class SystemConfigTabServices
|
||
* @package app\services\system\config
|
||
* @mixin SystemConfigTabDao
|
||
*/
|
||
class SystemConfigTabServices extends BaseServices
|
||
{
|
||
/**
|
||
* @var SystemConfigTabDao
|
||
*/
|
||
#[Inject]
|
||
protected SystemConfigTabDao $dao;
|
||
|
||
/**
|
||
* 系统设置头部分类读取
|
||
* @param int $pid
|
||
* @param int $is_store
|
||
* @return array
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
*/
|
||
public function getConfigTab(int $pid, int $is_store = 0)
|
||
{
|
||
$list = $this->dao->getConfigTabAll(['status' => 1, 'pid' => $pid, 'is_store' => $is_store], ['id', 'id as value', 'title as label', 'pid', 'icon', 'type'], $pid ? [] : [['type', '=', '0']]);
|
||
return get_tree_children($list);
|
||
}
|
||
|
||
/**
|
||
* 获取配置分类列表
|
||
* @param array $where
|
||
* @return array
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
*/
|
||
public function getConfgTabList(array $where)
|
||
{
|
||
[$page, $limit] = $this->getPageValue();
|
||
$list = $this->dao->getConfgTabList($where, $page, $limit);
|
||
$count = $this->dao->count($where);
|
||
$menusValue = [];
|
||
foreach ($list as $item) {
|
||
$menusValue[] = $item->getData();
|
||
}
|
||
$list = get_tree_children($menusValue);
|
||
return compact('list', 'count');
|
||
}
|
||
|
||
/**
|
||
* 获取配置分类选择下拉树
|
||
* @return array
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
*/
|
||
public function getSelectForm()
|
||
{
|
||
$menuList = $this->dao->getConfigTabAll([], ['id as value', 'pid', 'title as label']);
|
||
$menus = [['value' => 0, 'label' => '顶级按钮']];
|
||
$list = get_tree_children($menuList, 'children', 'value');
|
||
$menus = array_merge($menus, $list);
|
||
// foreach ($list as $menu) {
|
||
// $menus[] = ['value' => $menu['id'], 'label' => $menu['html'] . $menu['title']];
|
||
// }
|
||
return $menus;
|
||
}
|
||
|
||
/**
|
||
* 创建form表单
|
||
* @param array $formData
|
||
* @return array
|
||
* @throws \FormBuilder\Exception\FormBuilderException
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
*/
|
||
public function createConfigTabForm(array $formData = [])
|
||
{
|
||
$pid[] = isset($formData['pid']) ? $formData['pid'] : 0;
|
||
// $form[] = Form::radio('is_store', '类型', $formData['is_store'] ?? 0)->options([['value' => 0, 'label' => '总后台'], ['value' => 1, 'label' => '门店后台']]);
|
||
$form[] = Form::cascader('pid', '父级分类:', $pid)->data($this->getSelectForm())->changeOnSelect(true);
|
||
$form[] = Form::input('title', '分类名称:', $formData['title'] ?? '');
|
||
$form[] = Form::input('eng_title', '分类字段英文:', $formData['eng_title'] ?? '');
|
||
$form[] = Form::frameInput('icon', '图标:', $this->url('admin/widget.widgets/icon', ['fodder' => 'icon'], true), $formData['icon'] ?? '')->icon('ios-ionic')->height('435px');
|
||
$form[] = Form::radio('type', '类型:', $formData['type'] ?? 0)->options([
|
||
['value' => 0, 'label' => '系统'],
|
||
['value' => 3, 'label' => '其它']
|
||
]);
|
||
$form[] = Form::radio('status', '状态:', $formData['status'] ?? 1)->options([['value' => 1, 'label' => '显示'], ['value' => 2, 'label' => '隐藏']]);
|
||
$form[] = Form::number('sort', '排序:', (int)($formData['sort'] ?? 0))->min(0);
|
||
return $form;
|
||
}
|
||
|
||
/**
|
||
* 添加配置分类表单
|
||
* @return array
|
||
* @throws \FormBuilder\Exception\FormBuilderException
|
||
*/
|
||
public function createForm()
|
||
{
|
||
return create_form('添加配置分类', $this->createConfigTabForm(), $this->url('/setting/config_class'));
|
||
}
|
||
|
||
/**
|
||
* 修改配置分类表单
|
||
* @param int $id
|
||
* @return array
|
||
* @throws \FormBuilder\Exception\FormBuilderException
|
||
*/
|
||
public function updateForm(int $id)
|
||
{
|
||
$configTabInfo = $this->dao->get($id);
|
||
if (!$configTabInfo) {
|
||
throw new AdminException('没有查到数据,无法修改!');
|
||
}
|
||
return create_form('编辑配置分类', $this->createConfigTabForm($configTabInfo->toArray()), $this->url('/setting/config_class/' . $id), 'PUT');
|
||
}
|
||
}
|