diff --git a/.env b/.env index 5faa42e..3410a9b 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -APP_DEBUG = false +APP_DEBUG = true DB_TYPE = mysql DB_HOST = 127.0.0.1 diff --git a/app/model/Order.php b/app/model/Order.php index 0b26a12..aa310d7 100644 --- a/app/model/Order.php +++ b/app/model/Order.php @@ -101,14 +101,16 @@ class Order extends BaseModel public static function showOrderDetail($id) { $order = self::find($id); - $a_list = PayAccount::with('payChannel')->hasWhere('payChannel', ['id' => $order->cid])->where('PayAccount.id', $order->aid)->find(); + $a_list = PayAccount::find($order->aid); + $c_list = PayChannel::find($order->cid); if (!$order) { return []; } - $order->platform = $a_list->platform ?? '···'; - $order->account = $a_list->account ?? '···'; - $order->channel = $a_list->payChannel[0]->channel ?? '···'; - $order->qrcode = $a_list->payChannel[0]->qrcode ?? '···'; + $order->platform = $a_list['platform'] ?? '···'; + $order->account = $a_list['account'] ?? '···'; + $order->channel = $c_list['channel'] ?? '···'; + $order->qrcode = $c_list['qrcode'] ?? '···'; + $order->url_type = $c_list['type'] ?? '···'; return $order->toArray(); } // 选择收款通道 diff --git a/view/order/show_order.html b/view/order/show_order.html index 91e8711..fea5784 100644 --- a/view/order/show_order.html +++ b/view/order/show_order.html @@ -198,7 +198,8 @@
+ data-qrcode="" data-type="">
@@ -215,16 +216,28 @@ util.on({ getQrcode: function () { (async () => { - const qrcode_data = this.getAttribute("data-qrcode") - const qrcode_img = await getQrcode(qrcode_data, QR); - layer.open({ - type: 1, - area: ['200px', '200px'], - title: false, - closeBtn: 0, - shadeClose: true, - content: `` - }); + const type_data = this.getAttribute("data-type"); + const qrcode_data = this.getAttribute("data-qrcode"); + if (type_data == 1) { + layer.open({ + type: 1, + area: ['200px', '200px'], + title: false, + closeBtn: 0, + shadeClose: true, + content: `` + }); + } else if (type_data == 0) { + const qrcode_img = await getQrcode(qrcode_data, QR); + layer.open({ + type: 1, + area: ['200px', '200px'], + title: false, + closeBtn: 0, + shadeClose: true, + content: `` + }); + } })() } });