Files
coolcoth.com/app/Views/admin/order_show.php
T
2026-08-08 15:53:53 +08:00

34 lines
2.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php /** @var array $o */ /** @var array $payments */ /** @var string $seg */ ?>
<div class="page-head">
<div><h1>订单详情</h1><div class="desc">订单号 <?php echo e($o['order_no']); ?></div></div>
<a class="btn-ghost" href="<?php echo site_url('admin/orders'); ?>">← 返回列表</a>
</div>
<div class="admin-card">
<table class="admin-table">
<tr><th>商品</th><td><?php echo e($o['product_name']); ?></td></tr>
<tr><th>客户</th><td><?php echo e($o['customer_name']); ?><?php echo e($o['phone']); ?><?php if (!empty($o['email'])): ?>/ <?php echo e($o['email']); ?><?php endif; ?></td></tr>
<tr><th>数量</th><td><?php echo e($o['qty']); ?> 套</td></tr>
<tr><th>金额</th><td>¥<?php echo e($o['amount']); ?></td></tr>
<tr><th>支付通道</th><td><?php echo $o['channel'] === 'wechat' ? '微信' : ($o['channel'] === 'alipay' ? '支付宝' : '—'); ?></td></tr>
<tr><th>状态</th><td><?php echo $o['status'] === 'paid' ? '已支付' : '待支付'; ?><?php if (!empty($o['paid_at'])): echo '' . e($o['paid_at']) . ''; ?><?php endif; ?></td></tr>
<tr><th>网关交易号</th><td><?php echo e($o['gateway_trade_no'] ?? '—'); ?></td></tr>
<tr><th>下单时间</th><td><?php echo e($o['created_at']); ?></td></tr>
</table>
<?php if ($o['status'] !== 'paid'): ?>
<form method="post" action="<?php echo site_url('admin/orders/markPaid/' . $o['id']); ?>" style="margin-top:16px">
<?php echo csrf_field(); ?><button class="btn-primary" type="submit" data-confirm="标记为已支付?">标记为已支付</button>
</form>
<?php endif; ?>
<?php if ($payments): ?>
<h3 style="margin:24px 0 10px">付款记录</h3>
<table class="admin-table">
<thead><tr><th>通道</th><th>交易号</th><th>金额</th><th>状态</th><th>付款时间</th></tr></thead>
<tbody>
<?php foreach ($payments as $p): ?>
<tr><td><?php echo $p['channel'] === 'wechat' ? '微信' : '支付宝'; ?></td><td><?php echo e($p['trade_no']); ?></td><td>¥<?php echo e($p['amount']); ?></td><td><?php echo e($p['status']); ?></td><td><?php echo e($p['paid_at']); ?></td></tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>