feat: 完善会员资金明细与退款转账逻辑,新增支付密码组件与资金流水界面

这个提交包含在:
2026-10-24 17:55:36 +08:00
父节点 6b86177b5f
当前提交 b6c53abb84
共有 30 个文件被更改,包括 1222 次插入 和 537 次删除

查看文件

@@ -80,6 +80,9 @@ class FcInstall extends Command
$output->writeln('==> 发布模式与发布套餐升级');
$this->upgradePublish($output);
$output->writeln('==> 系统配置分组整理');
$this->upgradeConfigGroups($output);
$output->writeln('==> LBS / 店铺装修 / 支付 / 优惠券 / 举报升级(v1.7.0)');
$this->upgradeV170($output);
@@ -151,16 +154,16 @@ class FcInstall extends Command
/**
* 发布模式与发布套餐升级(幂等,可重复执行)
*
* 背景:v1.0.7 新增「免费发布 / 付费发布」开关与付费发布的三档定价
* 背景:v1.0.7 新增「免费发布 / 付费发布」开关与付费发布定价
* · 单条价格 post.singlePrice
* · 免费发布条数 post.freeQuota / post.freeQuotaCycle(v1.0.10:达到条数后按单条价格计费)
* · 按月(价格 + 含条数)post.monthPrice / post.monthQuota
* · 按年(价格 + 含条数)post.yearPrice / post.yearQuota
* 套餐价格与含发布条数唯一真源 = fc_plan(后台「运营推广 → 会员套餐」维护),
* 不再使用 post.monthPrice / post.yearPrice 等配置键(历史键在本步骤清理)。
* 老库缺列/缺配置时补齐,**不覆盖运营已改过的值**:
* ① fc_user_ext 补 post_quota_left / post_quota_expire(剩余发布条数 + 有效期)
* ② fc_plan 补 post_quota(套餐含发布条数,月/年卡赠送额度)
* ③ fc_config 补 post.* 八项(已存在则跳过)
* ④ 月卡/年卡的价格与条数以配置为准做一次同步(配置缺失时反向用套餐值填配置)
* ③ fc_config 补 post.* 四项(已存在则跳过)
* ④ 清理历史遗留的套餐定价配置键(post.month* / post.year* / fee.*)
*/
private function upgradePublish(Output $output)
{
@@ -197,10 +200,6 @@ class FcInstall extends Command
['post.singlePrice', '5', 'post', '单条发布价格(元)=付费发布标准价'],
['post.freeQuota', '0', 'post', '免费发布条数(0 = 不限制/免费到底;达到条数后按单条发布价格计费)'],
['post.freeQuotaCycle', 'day', 'post', '免费条数统计周期:day 每日 / month 每月 / total 累计'],
['post.monthPrice', '19.9', 'post', '按月发布价格(元)'],
['post.monthQuota', '30', 'post', '按月含发布条数'],
['post.yearPrice', '168', 'post', '按年发布价格(元)'],
['post.yearQuota', '500', 'post', '按年含发布条数'],
];
$now = time();
$added = [];
@@ -219,27 +218,14 @@ class FcInstall extends Command
$changed++;
}
// ④ 月/年卡「价格 + 含发布条数」与配置对齐
$map = ['M1' => ['post.monthPrice', 'post.monthQuota'], 'M12' => ['post.yearPrice', 'post.yearQuota']];
$synced = 0;
foreach ($map as $code => $keys) {
$plan = Db::name('fc_plan')->where('plan_code', $code)->find();
if (!$plan) {
continue;
}
$price = round((float)$this->cfgValue($keys[0], $plan['price']), 2);
$quota = (int)$this->cfgValue($keys[1], $plan['post_quota']);
if (round((float)$plan['price'], 2) !== $price || (int)$plan['post_quota'] !== $quota) {
Db::name('fc_plan')->where('id', $plan['id'])->update([
'price' => $price,
'post_quota' => $quota,
'updatetime' => time(),
]);
$synced++;
}
}
if ($synced) {
$output->writeln(' - 会员套餐已与发布配置对齐 ' . $synced . ' 条(月/年卡价格与含条数)');
// ④ 清理历史遗留配置键:套餐定价已统一到 fc_plan,发布免费条数只认 post.freeQuota
$deprecated = [
'post.monthPrice', 'post.monthQuota', 'post.yearPrice', 'post.yearQuota',
'fee.singlePost', 'fee.freePostPerDay', 'fee.memberMonth', 'fee.memberQuarter', 'fee.memberYear',
];
$removedKeys = Db::name('fc_config')->where('key', 'in', $deprecated)->delete();
if ($removedKeys) {
$output->writeln(' - 清理废弃配置 ' . $removedKeys . ' 项(套餐定价真源已统一为 fc_plan)');
$changed++;
}
@@ -248,6 +234,43 @@ class FcInstall extends Command
: ' - 发布模式与套餐配置已是最新,无需处理');
}
/**
* 系统配置分组整理(幂等)
*
* 背景:fa_config 的 configgroup 字典保留了 FastAdmin 演示分组 user(会员配置)与
* example(示例分组),两者没有任何配置项,却会在「系统配置」页渲染出空白 tab,
* 且 user 与业务分组「会员配置」重名易混淆;这里从字典中移除。
*/
private function upgradeConfigGroups(Output $output)
{
$row = Db::name('config')->where('name', 'configgroup')->find();
if (!$row) {
$output->writeln(' - 未找到 configgroup 字典,跳过');
return;
}
$decoded = json_decode((string)$row['value'], true);
if (!is_array($decoded)) {
$output->writeln(' - configgroup 字典格式异常,跳过');
return;
}
$target = ['basic', 'email', 'dictionary'];
$kept = [];
foreach ($decoded as $k => $v) {
if (in_array($k, $target, true) || strpos((string)$k, 'fc_') === 0) {
$kept[$k] = $v;
}
}
if ($kept === $decoded) {
$output->writeln(' - 系统配置分组已是最新,无需处理');
return;
}
Db::name('config')->where('name', 'configgroup')->update([
'value' => json_encode($kept, JSON_UNESCAPED_UNICODE),
]);
$removed = array_diff(array_keys($decoded), array_keys($kept));
$output->writeln(' - 已移除空分组:' . implode(' / ', $removed));
}
/**
* v1.7.0 升级:LBS 经纬度 / 店铺装修字段 / 收藏关注 / 支付与举报配置(幂等,可重复执行)
*
@@ -642,6 +665,21 @@ class FcInstall extends Command
protected function tables()
{
return [
'wallet_flow' => "CREATE TABLE IF NOT EXISTS `#P#wallet_flow` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
`flow_no` varchar(32) NOT NULL DEFAULT '' COMMENT '流水号',
`type` varchar(10) NOT NULL DEFAULT '' COMMENT 'income=入账 expense=支出(用户钱包口径)',
`scene` varchar(32) NOT NULL DEFAULT '' COMMENT '场景:余额充值/后台充值/会员开通/发布付费/付费查看/订单退款(余额)/佣金提现',
`amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变动金额',
`balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变动后钱包余额(fa_user.money)',
`related_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '关联单据ID(订单/信息/提现单)',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
`createtime` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `flow_no` (`flow_no`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同城-用户钱包流水';",
'config' => "CREATE TABLE IF NOT EXISTS `#P#config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(64) NOT NULL DEFAULT '' COMMENT '配置键',
@@ -860,6 +898,7 @@ class FcInstall extends Command
`free_view_used` int(10) NOT NULL DEFAULT '0',
`post_quota_left` int(10) NOT NULL DEFAULT '0' COMMENT '剩余发布条数(月/年套餐赠送)',
`post_quota_expire` int(10) DEFAULT NULL COMMENT '发布额度有效期(=会员到期时间)',
`pay_password` varchar(255) NOT NULL DEFAULT '' COMMENT '支付密码(password_hash,空=未设置)',
`createtime` int(10) DEFAULT NULL,
`updatetime` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
@@ -921,6 +960,7 @@ class FcInstall extends Command
'finance_flow' => "CREATE TABLE IF NOT EXISTS `#P#finance_flow` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '归属用户,0=平台/历史数据',
`flow_no` varchar(32) NOT NULL DEFAULT '',
`type` varchar(16) NOT NULL DEFAULT 'income' COMMENT 'income/expense',
`scene` varchar(32) NOT NULL DEFAULT '' COMMENT '业务场景',
@@ -930,7 +970,8 @@ class FcInstall extends Command
`remark` varchar(255) NOT NULL DEFAULT '',
`createtime` int(10) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `flow_no` (`flow_no`)
UNIQUE KEY `flow_no` (`flow_no`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同城-资金流水';",
'message' => "CREATE TABLE IF NOT EXISTS `#P#message` (
@@ -1035,20 +1076,12 @@ class FcInstall extends Command
['wx.secret', 'b023726713eebe3dad3876f5cea8ee6a', 'wx', '小程序AppSecret(仅服务端持有,不下发前端)'],
['pay.mchId', '', 'pay', '微信支付商户号'],
['pay.apiKey', '', 'pay', '微信支付密钥'],
['fee.singlePost', '5', 'fee', '单条发布价格(元)'],
['fee.freePostPerDay', '2', 'fee', '每日免费发布条数'],
['fee.memberMonth', '19.9', 'fee', '月卡价格'],
['fee.memberQuarter', '49.9', 'fee', '季卡价格'],
['fee.memberYear', '168', 'fee', '年卡价格'],
// 发布模式与发布套餐(后台「发布与费用配置」页维护;真源=配置,保存时同步 fc_plan)
// 发布模式与发布价格(后台「系统配置 → 发布配置」维护)
// 套餐价格与含发布条数在 fc_plan(后台「运营推广 → 会员套餐」维护),不走配置键
['post.mode', 'free', 'post', '发布模式:free 免费发布 / paid 付费发布(默认免费,避免上线即撞付费墙)'],
['post.singlePrice', '5', 'post', '单条发布价格(元)=付费发布标准价'],
['post.freeQuota', '0', 'post', '免费发布条数(0 = 不限制/免费到底;达到条数后按单条发布价格计费)'],
['post.freeQuotaCycle', 'day', 'post', '免费条数统计周期:day 每日 / month 每月 / total 累计'],
['post.monthPrice', '19.9', 'post', '按月发布价格(元)'],
['post.monthQuota', '30', 'post', '按月含发布条数'],
['post.yearPrice', '168', 'post', '按年发布价格(元)'],
['post.yearQuota', '500', 'post', '按年含发布条数'],
['dist.enabled', '1', 'dist', '是否开启分销'],
['dist.level', '2', 'dist', '分佣层级'],
['dist.level1Rate', '20', 'dist', '一级分佣比例%'],

查看文件

@@ -134,6 +134,7 @@ class FcVerifyDist extends Command
'updatetime' => time(),
]);
Db::name('fc_finance_flow')->insert([
'user_id' => $userBId,
'flow_no' => 'WD' . date('YmdHis') . $withdrawId,
'type' => 'expense',
'scene' => '佣金提现',

查看文件

@@ -101,6 +101,7 @@ class Order extends Backend
'updatetime' => time(),
]);
Db::name('fc_finance_flow')->insert([
'user_id' => (int)$order['user_id'],
'flow_no' => 'SK' . date('YmdHis') . $order['id'],
'type' => 'income',
'scene' => '订单补单',

查看文件

@@ -1,158 +0,0 @@
<?php
namespace app\admin\controller\fc;
use app\common\controller\Backend;
use think\Db;
/**
* 同城-发布与费用配置
*
* 本页是「发布模式 + 发布价格/条数」的唯一入口:
* 真源 = fa_fc_config 的 post.* 分组;保存时同步 fa_fc_plan 的月/年卡价格与含发布条数,
* 保证「发布页价格」「会员中心套餐价」「后端计费」三者一致。
*
* post.mode free 免费发布 / paid 付费发布
* post.singlePrice 单条发布价格(元)=「付费发布」标准价
* post.freeQuota 免费发布条数(0 = 不限制/免费到底;超出即按 singlePrice 计费)
* post.freeQuotaCycle 免费条数统计周期:day 每日 / month 每月 / total 累计
* post.monthPrice 按月发布价格(元)
* post.monthQuota 按月含发布条数
* post.yearPrice 按年发布价格(元)
* post.yearQuota 按年含发布条数
*
* @icon fa fa-cny
*/
class Publish extends Backend
{
/** 发布模式取值 */
const MODES = ['free', 'paid'];
/** 免费条数统计周期取值 */
const CYCLES = ['day', 'month', 'total'];
/**
* 配置页(GET 显示 / POST 保存)
*/
public function index()
{
if ($this->request->isPost()) {
return $this->save();
}
$this->view->assign('row', $this->current());
$this->view->assign('plans', Db::name('fc_plan')->order('sort asc')->select());
return $this->view->fetch();
}
/**
* 保存配置并同步会员套餐
*/
protected function save()
{
$params = $this->request->post('row/a');
if (!is_array($params)) {
$params = $this->request->post();
}
$mode = isset($params['mode']) ? trim((string)$params['mode']) : 'paid';
if (!in_array($mode, self::MODES, true)) {
$this->error('发布模式只支持「免费发布」或「付费发布」');
}
$num = function ($key, $default) use ($params) {
if (!isset($params[$key]) || $params[$key] === '') {
return $default;
}
return round((float)$params[$key], 2);
};
$int = function ($key, $default) use ($params) {
if (!isset($params[$key]) || $params[$key] === '') {
return $default;
}
return (int)$params[$key];
};
$single = $num('singlePrice', 5);
$monthPrice = $num('monthPrice', 19.9);
$yearPrice = $num('yearPrice', 168);
$monthQuota = $int('monthQuota', 30);
$yearQuota = $int('yearQuota', 500);
// 免费发布条数:0 = 不限制(免费到底);达到条数后按「单条发布价格」计费
$freeQuota = $int('freeQuota', 0);
$freeQuotaCycle = isset($params['freeQuotaCycle']) ? trim((string)$params['freeQuotaCycle']) : 'day';
if (!in_array($freeQuotaCycle, self::CYCLES, true)) {
$this->error('免费条数统计周期只支持「每日 / 每月 / 累计」');
}
foreach (['单条发布价格' => $single, '按月发布价格' => $monthPrice, '按年发布价格' => $yearPrice] as $label => $v) {
if ($v < 0) {
$this->error($label . '不能为负');
}
}
if ($monthQuota < 0 || $yearQuota < 0) {
$this->error('含发布条数不能为负');
}
if ($freeQuota < 0) {
$this->error('免费发布条数不能为负(0 表示不限制)');
}
$now = time();
$values = [
'post.mode' => $mode,
'post.singlePrice' => $single,
'post.freeQuota' => $freeQuota,
'post.freeQuotaCycle' => $freeQuotaCycle,
'post.monthPrice' => $monthPrice,
'post.monthQuota' => $monthQuota,
'post.yearPrice' => $yearPrice,
'post.yearQuota' => $yearQuota,
];
foreach ($values as $key => $val) {
$exist = Db::name('fc_config')->where('key', $key)->find();
if ($exist) {
Db::name('fc_config')->where('key', $key)->update(['value' => (string)$val, 'updatetime' => $now]);
} else {
Db::name('fc_config')->insert([
'key' => $key, 'value' => (string)$val, 'group_key' => 'post',
'remark' => '发布与费用配置', 'createtime' => $now, 'updatetime' => $now,
]);
}
}
// 同步月/年卡(价格 + 含发布条数);季卡价格按「月卡 ×3」的默认口径不动
Db::name('fc_plan')->where('plan_code', 'M1')->update([
'price' => $monthPrice, 'post_quota' => $monthQuota, 'updatetime' => $now,
]);
Db::name('fc_plan')->where('plan_code', 'M12')->update([
'price' => $yearPrice, 'post_quota' => $yearQuota, 'updatetime' => $now,
]);
$this->success('发布配置已保存并同步会员套餐');
}
/** 当前配置(缺失时回落 fee.* 与内置默认) */
protected function current()
{
$cfg = [];
foreach (Db::name('fc_config')->select() as $r) {
$cfg[$r['key']] = $r['value'];
}
$pick = function ($key, $default) use ($cfg) {
return (isset($cfg[$key]) && $cfg[$key] !== '') ? $cfg[$key] : $default;
};
$mode = (string)$pick('post.mode', 'paid');
return [
'mode' => in_array($mode, self::MODES, true) ? $mode : 'paid',
'singlePrice' => $pick('post.singlePrice', $pick('fee.singlePost', '5')),
// 免费发布条数:老库未保存过时回落 fee.freePostPerDay(默认 0 = 不限制)
'freeQuota' => $pick('post.freeQuota', $pick('fee.freePostPerDay', '0')),
'freeQuotaCycle' => $pick('post.freeQuotaCycle', 'day'),
'monthPrice' => $pick('post.monthPrice', $pick('fee.memberMonth', '19.9')),
'monthQuota' => $pick('post.monthQuota', '30'),
'yearPrice' => $pick('post.yearPrice', $pick('fee.memberYear', '168')),
'yearQuota' => $pick('post.yearQuota', '500'),
];
}
}

查看文件

@@ -109,11 +109,25 @@ class Userext extends Backend
'updatetime' => $now,
]);
// 资金流水(平台口径:余额充值属于收入)
// 资金流水(平台口径:充值属于收入;scene=后台充值 与用户微信充值区分)
Db::name('fc_finance_flow')->insert([
'user_id' => $uid,
'flow_no' => 'R' . date('YmdHis') . mt_rand(100, 999) . $uid,
'type' => 'income',
'scene' => '余额充值',
'scene' => '后台充值',
'amount' => $amount,
'balance' => $balance,
'related_id' => $uid,
'remark' => $remark !== '' ? $remark : ('后台充值给用户 #' . $uid),
'createtime' => $now,
]);
// 用户钱包流水(fa_user.money 增)→ 余额中心「余额明细」
Db::name('fc_wallet_flow')->insert([
'user_id' => $uid,
'flow_no' => 'W' . date('YmdHis') . mt_rand(100, 999) . $uid,
'type' => 'income',
'scene' => '后台充值',
'amount' => $amount,
'balance' => $balance,
'related_id' => $uid,

查看文件

@@ -1,48 +0,0 @@
<?php
return [
'说明' => '说明',
'发布模式' => '发布模式',
'免费发布(所有用户均可免费发布)' => '免费发布(所有用户均可免费发布)',
'付费发布(按下面价格计费,套餐额度内免费)' => '付费发布(按下面价格计费,套餐额度内免费)',
'会员单条发布价格' => '会员单条发布价格',
'免费发布条数' => '免费发布条数',
'条' => '条',
'每日' => '每日',
'每月' => '每月',
'累计' => '累计',
'会员按月发布' => '会员按月发布',
'会员按年发布' => '会员按年发布',
'元/条' => '元/条',
'元/月' => '元/月',
'元/年' => '元/年',
'条/月' => '条/月',
'条/年' => '条/年',
'保存' => '保存',
'是否' => '是否',
'是' => '是',
'否' => '否',
'当前会员套餐' => '当前会员套餐',
'套餐编码' => '套餐编码',
'套餐名称' => '套餐名称',
'售价' => '售价',
'有效天数' => '有效天数',
'含发布条数' => '含发布条数',
'是否启用' => '是否启用',
'本页是「发布模式 + 发布价格/条数」的唯一入口;保存后会同步「会员套餐」的月/年卡价格与含发布条数,因此用户端发布页、会员中心与后端计费口径一致。'
=> '本页是「发布模式 + 发布价格/条数」的唯一入口;保存后会同步「会员套餐」的月/年卡价格与含发布条数,因此用户端发布页、会员中心与后端计费口径一致。',
'「会员单条发布价格」= 未购买套餐时按条计费的价格;「按月/按年」= 会员套餐价格,并赠送对应条数的发布额度(额度随会员有效期,过期自动清零)。'
=> '「会员单条发布价格」= 未购买套餐时按条计费的价格;「按月/按年」= 会员套餐价格,并赠送对应条数的发布额度(额度随会员有效期,过期自动清零)。',
'未开通套餐的用户按此价格付费发布(金额由服务端计算,前端不可传价)'
=> '未开通套餐的用户按此价格付费发布(金额由服务端计算,前端不可传价)',
'免费发布条数:免费发布模式下前 N 条免费,达到条数后按「会员单条发布价格」计费(计费标准与付费发布一致);付费发布模式下同样保留这 N 条免费额度(避免一开付费就是硬付费墙)。填 0 = 不限制(免费到底)。'
=> '免费发布条数:免费发布模式下前 N 条免费,达到条数后按「会员单条发布价格」计费(计费标准与付费发布一致);付费发布模式下同样保留这 N 条免费额度(避免一开付费就是硬付费墙)。填 0 = 不限制(免费到底)。',
'计费顺序:套餐额度 → 免费发布条数 → 单条付费;免费发布条数达到后即按「会员单条发布价格」计费,金额一律由服务端计算。'
=> '计费顺序:套餐额度 → 免费发布条数 → 单条付费;免费发布条数达到后即按「会员单条发布价格」计费,金额一律由服务端计算。',
'价格与条数会同步到「会员套餐 → 月卡(M1)」;购买后立即赠送该条数的发布额度'
=> '价格与条数会同步到「会员套餐 → 月卡(M1)」;购买后立即赠送该条数的发布额度',
'价格与条数会同步到「会员套餐 → 年卡(M12)」;购买后立即赠送该条数的发布额度'
=> '价格与条数会同步到「会员套餐 → 年卡(M12)」;购买后立即赠送该条数的发布额度',
'(月/年卡的价格与含发布条数由本页同步,其余字段在「交易管理 → 会员套餐」维护)'
=> '(月/年卡的价格与含发布条数由本页同步,其余字段在「交易管理 → 会员套餐」维护)',
];

查看文件

@@ -1,138 +0,0 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div class="alert alert-info" style="margin-bottom:16px;">
<strong>{:__('说明')}:</strong>
{:__('本页是「发布模式 + 发布价格/条数」的唯一入口;保存后会同步「会员套餐」的月/年卡价格与含发布条数,因此用户端发布页、会员中心与后端计费口径一致。')}
<br/>
{:__('「会员单条发布价格」= 未购买套餐时按条计费的价格;「按月/按年」= 会员套餐价格,并赠送对应条数的发布额度(额度随会员有效期,过期自动清零)。')}
<br/>
{:__('计费顺序:套餐额度 → 免费发布条数 → 单条付费;免费发布条数达到后即按「会员单条发布价格」计费,金额一律由服务端计算。')}
</div>
<div class="widget-body no-padding">
<form class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="{:url('fc/publish/index')}">
{:token()}
<table class="table table-striped">
<tbody>
<tr>
<th width="22%">{:__('发布模式')}</th>
<td>
<label class="radio-inline">
<input type="radio" name="row[mode]" value="free" {if $row.mode=='free'}checked{/if}/>
{:__('免费发布(所有用户均可免费发布)')}
</label>
<label class="radio-inline">
<input type="radio" name="row[mode]" value="paid" {if $row.mode!='free'}checked{/if}/>
{:__('付费发布(按下面价格计费,套餐额度内免费)')}
</label>
</td>
</tr>
<tr>
<th>{:__('免费发布条数')}</th>
<td>
<div class="input-group" style="max-width:220px;display:inline-table;">
<input type="number" step="1" min="0" name="row[freeQuota]" class="form-control"
value="{$row.freeQuota}" data-rule="required;number"/>
<span class="input-group-addon">{:__('条')}</span>
</div>
<div class="input-group" style="max-width:220px;display:inline-table;margin-left:12px;">
<select name="row[freeQuotaCycle]" class="form-control">
<option value="day" {if $row.freeQuotaCycle=='day'}selected{/if}>{:__('每日')}</option>
<option value="month" {if $row.freeQuotaCycle=='month'}selected{/if}>{:__('每月')}</option>
<option value="total" {if $row.freeQuotaCycle=='total'}selected{/if}>{:__('累计')}</option>
</select>
</div>
<span class="help-block">{:__('免费发布条数:免费发布模式下前 N 条免费,达到条数后按「会员单条发布价格」计费(计费标准与付费发布一致);付费发布模式下同样保留这 N 条免费额度(避免一开付费就是硬付费墙)。填 0 = 不限制(免费到底)。')}</span>
</td>
</tr>
<tr>
<th>{:__('会员单条发布价格')}</th>
<td>
<div class="input-group" style="max-width:220px;">
<span class="input-group-addon">¥</span>
<input type="number" step="0.01" min="0" name="row[singlePrice]" class="form-control"
value="{$row.singlePrice}" data-rule="required;number"/>
<span class="input-group-addon">{:__('元/条')}</span>
</div>
<span class="help-block">{:__('未开通套餐的用户按此价格付费发布(金额由服务端计算,前端不可传价)')}</span>
</td>
</tr>
<tr>
<th>{:__('会员按月发布')}</th>
<td>
<div class="input-group" style="max-width:220px;display:inline-table;">
<span class="input-group-addon">¥</span>
<input type="number" step="0.01" min="0" name="row[monthPrice]" class="form-control"
value="{$row.monthPrice}" data-rule="required;number"/>
<span class="input-group-addon">{:__('元/月')}</span>
</div>
<div class="input-group" style="max-width:220px;display:inline-table;margin-left:12px;">
<input type="number" step="1" min="0" name="row[monthQuota]" class="form-control"
value="{$row.monthQuota}" data-rule="required;number"/>
<span class="input-group-addon">{:__('条/月')}</span>
</div>
<span class="help-block">{:__('价格与条数会同步到「会员套餐 → 月卡(M1)」;购买后立即赠送该条数的发布额度')}</span>
</td>
</tr>
<tr>
<th>{:__('会员按年发布')}</th>
<td>
<div class="input-group" style="max-width:220px;display:inline-table;">
<span class="input-group-addon">¥</span>
<input type="number" step="0.01" min="0" name="row[yearPrice]" class="form-control"
value="{$row.yearPrice}" data-rule="required;number"/>
<span class="input-group-addon">{:__('元/年')}</span>
</div>
<div class="input-group" style="max-width:220px;display:inline-table;margin-left:12px;">
<input type="number" step="1" min="0" name="row[yearQuota]" class="form-control"
value="{$row.yearQuota}" data-rule="required;number"/>
<span class="input-group-addon">{:__('条/年')}</span>
</div>
<span class="help-block">{:__('价格与条数会同步到「会员套餐 → 年卡(M12)」;购买后立即赠送该条数的发布额度')}</span>
</td>
</tr>
</tbody>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success btn-embossed">{:__('保存')}</button>
</div>
</div>
</form>
</div>
<div class="widget-body no-padding">
<div class="alert alert-warning" style="margin:16px 0 8px;">
<strong>{:__('当前会员套餐')}</strong>
{:__('(月/年卡的价格与含发布条数由本页同步,其余字段在「交易管理 → 会员套餐」维护)')}
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{:__('套餐编码')}</th>
<th>{:__('套餐名称')}</th>
<th>{:__('售价')}</th>
<th>{:__('有效天数')}</th>
<th>{:__('含发布条数')}</th>
<th>{:__('是否启用')}</th>
</tr>
</thead>
<tbody>
{foreach $plans as $p}
<tr>
<td>{$p.plan_code}</td>
<td>{$p.name}</td>
<td>¥{$p.price}</td>
<td>{$p.days}</td>
<td>{$p.post_quota}</td>
<td>{if $p.enabled}{:__('是')}{else/}{:__('否')}{/if}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>