feat: 重构会员权益与分销配置,新增套餐维度权益管理
1. 新增会员权益配置控制器 Memberbenefit 和 Publish,拆分运营配置模块 2. 新增套餐表字段 free_view_quota、post_discount,支持按套餐配置免费看和发帖折扣 3. 优化前端页面,新增套餐编辑表单、区域选择器、发布配置交互 4. 新增调试支持,支持 mock openid、本地 IP 绕过权限,便于自动化测试 5. 新增数据库工具脚本,用于检查配置、修复数据、验证会员功能 6. 优化会员接口,返回套餐维度的权益信息,支持无限次免费看场景
这个提交包含在:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\fc;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\library\FcConfig;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* 同城-运营配置中心(统一管理:发布配置 / 浏览配置 / 分销配置)
|
||||
*
|
||||
* @icon fa fa-sliders
|
||||
*/
|
||||
class Publish extends Backend
|
||||
{
|
||||
/**
|
||||
* 展示与保存运营配置(支持多 Tab 切换)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$this->token();
|
||||
$row = $this->request->post('row/a', []);
|
||||
if (empty($row)) {
|
||||
$this->error(__('Parameter %s can not be empty', 'row'));
|
||||
}
|
||||
try {
|
||||
if (isset($row['fc_post_mode']) || isset($row['fc_fee_viewMode'])) {
|
||||
FcConfig::savePublish($row);
|
||||
}
|
||||
if (isset($row['fc_dist_level']) || isset($row['fc_dist_level1Rate'])) {
|
||||
FcConfig::saveDistribution($row);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('运营配置保存成功');
|
||||
}
|
||||
|
||||
$row = array_merge(
|
||||
FcConfig::getPublishConfig(),
|
||||
FcConfig::getDistributionConfig()
|
||||
);
|
||||
$this->view->assign('row', $row);
|
||||
$this->view->assign('title', '运营配置');
|
||||
return $this->view->fetch();
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户