feat: 新增发布额度权益与订单管理功能,优化多端交互细节
这个提交包含在:
@@ -3,6 +3,7 @@
|
||||
namespace app\admin\command;
|
||||
|
||||
use app\common\library\CouponService;
|
||||
use app\common\library\OrderClose;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
@@ -40,27 +41,20 @@ class FcSettle extends Command
|
||||
]);
|
||||
$output->writeln('==> 佣金结算:' . $settled . ' 笔');
|
||||
|
||||
/* 2. 关闭超时未支付订单(24 小时) */
|
||||
/* 2. 关闭超时未支付订单(统一走 OrderClose 规范化清理) */
|
||||
$timeout = OrderClose::getTimeoutSeconds();
|
||||
$expired = Db::name('fc_order')
|
||||
->where('status', 'pending')
|
||||
->where('createtime', '<', $now - 86400)
|
||||
->where('createtime', '<', $now - $timeout)
|
||||
->select();
|
||||
|
||||
$closed = 0;
|
||||
foreach ($expired as $order) {
|
||||
$affected = Db::name('fc_order')
|
||||
->where('id', (int)$order['id'])
|
||||
->where('status', 'pending')
|
||||
->update([
|
||||
'status' => 'closed',
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
if ($affected) {
|
||||
CouponService::release((string)$order['order_no']);
|
||||
if (OrderClose::close($order, 'timeout_auto')) {
|
||||
$closed++;
|
||||
}
|
||||
}
|
||||
$output->writeln('==> 关闭超时订单:' . $closed . ' 笔');
|
||||
$output->writeln('==> 关闭超时订单:' . $closed . ' 笔(超时阈值:' . round($timeout / 60) . ' 分钟)');
|
||||
|
||||
/* 3. 同步转账中的提现单(最多 20 笔) */
|
||||
$synced = 0;
|
||||
|
||||
在新工单中引用
屏蔽一个用户