fix(partner): 修复数据清理脚本中分销商及用户表字段名适配问题
这个提交包含在:
@@ -108,8 +108,14 @@ class PartnerClean extends Command
|
|||||||
`voucher_released` = 0.00,
|
`voucher_released` = 0.00,
|
||||||
`voucher_used` = 0.00,
|
`voucher_used` = 0.00,
|
||||||
`total_income` = 0.00,
|
`total_income` = 0.00,
|
||||||
`commission` = 0.00,
|
`child_order_money_0` = 0.00,
|
||||||
`total_consume` = 0.00,
|
`child_order_money_1` = 0.00,
|
||||||
|
`child_order_money_2` = 0.00,
|
||||||
|
`child_order_money_all` = 0.00,
|
||||||
|
`child_order_count_0` = 0,
|
||||||
|
`child_order_count_1` = 0,
|
||||||
|
`child_order_count_2` = 0,
|
||||||
|
`child_order_count_all` = 0,
|
||||||
`last_self_order_time` = NULL");
|
`last_self_order_time` = NULL");
|
||||||
$output->writeln(" [OK] 已将所有分销商持仓马豆、推三返一序号、兑换券及累计收益重置归零");
|
$output->writeln(" [OK] 已将所有分销商持仓马豆、推三返一序号、兑换券及累计收益重置归零");
|
||||||
}
|
}
|
||||||
@@ -120,16 +126,15 @@ class PartnerClean extends Command
|
|||||||
if ($this->tableExists($userTable)) {
|
if ($this->tableExists($userTable)) {
|
||||||
Db::execute("UPDATE `{$userTable}` SET
|
Db::execute("UPDATE `{$userTable}` SET
|
||||||
`commission` = 0.00,
|
`commission` = 0.00,
|
||||||
`total_consume` = 0.00,
|
`total_consume` = 0.00");
|
||||||
`order_count` = 0");
|
$output->writeln(" [OK] 已将所有会员钱包佣金、累计消费重置归零");
|
||||||
$output->writeln(" [OK] 已将所有会员钱包佣金、累计消费、订单计数重置归零");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6. 可选清理钱包流水表中佣金相关的记录
|
// 6. 可选清理钱包流水表中佣金相关的记录
|
||||||
if ($withWallet) {
|
if ($withWallet) {
|
||||||
$walletLogTable = $prefix . 'shopro_user_wallet_log';
|
$walletLogTable = $prefix . 'shopro_user_wallet_log';
|
||||||
if ($this->tableExists($walletLogTable)) {
|
if ($this->tableExists($walletLogTable)) {
|
||||||
Db::execute("DELETE FROM `{$walletLogTable}` WHERE `wallet_type` = 'commission' OR `event` IN ('reward_income', 'reward_back', 'order_pay', 'order_refund')");
|
Db::execute("DELETE FROM `{$walletLogTable}` WHERE `type` = 'commission' OR `event` IN ('reward_income', 'reward_back', 'order_pay', 'order_refund')");
|
||||||
$output->writeln(" [OK] 已清理佣金钱包及订单相关流水日志");
|
$output->writeln(" [OK] 已清理佣金钱包及订单相关流水日志");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,24 +54,29 @@ UPDATE `fa_shopro_commission_agent` SET
|
|||||||
`voucher_released` = 0.00,
|
`voucher_released` = 0.00,
|
||||||
`voucher_used` = 0.00,
|
`voucher_used` = 0.00,
|
||||||
`total_income` = 0.00,
|
`total_income` = 0.00,
|
||||||
`commission` = 0.00,
|
`child_order_money_0` = 0.00,
|
||||||
`total_consume` = 0.00,
|
`child_order_money_1` = 0.00,
|
||||||
|
`child_order_money_2` = 0.00,
|
||||||
|
`child_order_money_all` = 0.00,
|
||||||
|
`child_order_count_0` = 0,
|
||||||
|
`child_order_count_1` = 0,
|
||||||
|
`child_order_count_2` = 0,
|
||||||
|
`child_order_count_all` = 0,
|
||||||
`last_self_order_time` = NULL;
|
`last_self_order_time` = NULL;
|
||||||
|
|
||||||
-- ------------------------------------------------------------------------------
|
-- ------------------------------------------------------------------------------
|
||||||
-- 5. 重置会员 (User) 钱包分销佣金与交易统计 (UPDATE)
|
-- 5. 重置会员 (User) 钱包分销佣金与交易统计 (UPDATE)
|
||||||
-- 清空佣金钱包余额、累计消费、订单总数
|
-- 清空佣金钱包余额、累计消费
|
||||||
-- ------------------------------------------------------------------------------
|
-- ------------------------------------------------------------------------------
|
||||||
UPDATE `fa_user` SET
|
UPDATE `fa_user` SET
|
||||||
`commission` = 0.00,
|
`commission` = 0.00,
|
||||||
`total_consume` = 0.00,
|
`total_consume` = 0.00;
|
||||||
`order_count` = 0;
|
|
||||||
|
|
||||||
-- ------------------------------------------------------------------------------
|
-- ------------------------------------------------------------------------------
|
||||||
-- 6. 可选:清理钱包流水中关于佣金与订单相关的历史记录 (DELETE)
|
-- 6. 可选:清理钱包流水中关于佣金与订单相关的历史记录 (DELETE)
|
||||||
-- ------------------------------------------------------------------------------
|
-- ------------------------------------------------------------------------------
|
||||||
DELETE FROM `fa_shopro_user_wallet_log`
|
DELETE FROM `fa_shopro_user_wallet_log`
|
||||||
WHERE `wallet_type` = 'commission'
|
WHERE `type` = 'commission'
|
||||||
OR `event` IN ('reward_income', 'reward_back', 'order_pay', 'order_refund');
|
OR `event` IN ('reward_income', 'reward_back', 'order_pay', 'order_refund');
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户