feat: 收益全额直入商城余额、存量结转与奖项名称全局规范化对齐

这个提交包含在:
chen
2026-09-19 11:49:57 +08:00
父节点 85947e43ae
当前提交 aca0d3c671
共有 83 个文件被更改,包括 4146 次插入 和 443 次删除

查看文件

@@ -227,24 +227,8 @@ class PartnerInstall extends Command
protected function backfillLastSelfOrder(Output $output)
{
$rows = Db::name('shopro_order')
->where('status', 'in', ['paid', 'completed'])
->where('paid_time', '>', 0)
->field('user_id, max(paid_time) as last_paid')
->group('user_id')
->select();
$count = 0;
foreach ($rows as $row) {
$agent = Db::name('shopro_commission_agent')->where('user_id', $row['user_id'])->find();
if (!$agent || !empty($agent['last_self_order_time'])) {
continue;
}
Db::name('shopro_commission_agent')->where('user_id', $row['user_id'])->update([
'last_self_order_time' => intval($row['last_paid']),
]);
$count++;
}
$output->writeln("backfill last_self_order_time: {$count}");
$count = (new \addons\shopro\service\partner\ActiveService())->syncActiveTimes();
$output->writeln("backfill last_self_order_time (self + direct): {$count}");
}
protected function clearConfigCache(Output $output)