feat: 新增会员浏览/拨打额度并优化无图展示逻辑
新增会员每日浏览完整信息和拨打电话的额度配置,调整付费查看接口描述为解锁完整信息,优化帖子无图时的兜底展示逻辑,修复图片加载路径问题,删除废弃工具脚本。
这个提交包含在:
@@ -57,10 +57,10 @@ class AdminMember extends V1
|
||||
}
|
||||
|
||||
/**
|
||||
* AMB2 会员权益配置
|
||||
* POST /api/v1/admin/member/benefit 入参 {freeView,postDiscount,distRate,benefits[]}
|
||||
* → {freeView,postDiscount,distRate,benefits[]}
|
||||
* 未被传入的字段保持原值;freeView <0 报错
|
||||
* AMB2 会员权益配置(兜底默认值;各套餐的浏览/拨打次数以 fc_plan 为准)
|
||||
* POST /api/v1/admin/member/benefit 入参 {viewQuota,callQuota,postDiscount,distRate,benefits[]}
|
||||
* → {viewQuota,callQuota,postDiscount,distRate,benefits[]}
|
||||
* 未被传入的字段保持原值;次数 <0 报错
|
||||
*/
|
||||
public function saveBenefit()
|
||||
{
|
||||
@@ -69,12 +69,23 @@ class AdminMember extends V1
|
||||
$current = [];
|
||||
}
|
||||
|
||||
$freeView = $this->input('freeView', null);
|
||||
if ($freeView !== null && $freeView !== '') {
|
||||
if ((int)$freeView < 0) {
|
||||
$this->fail('免费查看条数不能为负');
|
||||
$viewQuota = $this->input('viewQuota', null);
|
||||
if ($viewQuota === null) {
|
||||
$viewQuota = $this->input('freeView', null); // 兼容旧字段
|
||||
}
|
||||
if ($viewQuota !== null && $viewQuota !== '') {
|
||||
if ((int)$viewQuota < 0) {
|
||||
$this->fail('每日浏览条数不能为负');
|
||||
}
|
||||
$current['freeView'] = (int)$freeView;
|
||||
$current['viewQuota'] = (int)$viewQuota;
|
||||
}
|
||||
|
||||
$callQuota = $this->input('callQuota', null);
|
||||
if ($callQuota !== null && $callQuota !== '') {
|
||||
if ((int)$callQuota < 0) {
|
||||
$this->fail('每日拨打次数不能为负');
|
||||
}
|
||||
$current['callQuota'] = (int)$callQuota;
|
||||
}
|
||||
|
||||
$postDiscount = $this->input('postDiscount', null);
|
||||
@@ -101,7 +112,8 @@ class AdminMember extends V1
|
||||
}
|
||||
|
||||
$defaults = [
|
||||
'freeView' => 20,
|
||||
'viewQuota' => 20,
|
||||
'callQuota' => 30,
|
||||
'postDiscount' => '8 折',
|
||||
'distRate' => '一级 20% / 二级 10%',
|
||||
'benefits' => [],
|
||||
@@ -112,7 +124,8 @@ class AdminMember extends V1
|
||||
$this->adminLog('修改会员权益配置');
|
||||
|
||||
$this->ok([
|
||||
'freeView' => (int)$current['freeView'],
|
||||
'viewQuota' => (int)$current['viewQuota'],
|
||||
'callQuota' => (int)$current['callQuota'],
|
||||
'postDiscount' => (string)$current['postDiscount'],
|
||||
'distRate' => (string)$current['distRate'],
|
||||
'benefits' => array_values((array)$current['benefits']),
|
||||
|
||||
在新工单中引用
屏蔽一个用户