Преглед на файлове

线下酒店等订单增加back_amount

Panda преди 1 седмица
родител
ревизия
49d3aebab2
променени са 2 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. 1 1
      application/api/controller/Payment.php
  2. 5 5
      application/common/business/PaymentBusiness.php

+ 1 - 1
application/api/controller/Payment.php

@@ -74,7 +74,7 @@ class Payment extends Api
             return $this->error('订单已支付');
         }
 
-        if (!$model->where('id',$params['bill_id'])->update(['pay_type'=>$payType,'platform'=>$platform])){
+        if (!$model->where('id',$bill['id'])->update(['pay_type'=>$payType,'platform'=>$platform])){
             return $this->error('操作失败');
         }
 

+ 5 - 5
application/common/business/PaymentBusiness.php

@@ -140,7 +140,7 @@ class PaymentBusiness extends BusinessResult
 
         $billModel = new BillModel();
         $bill      = $billModel->getDetail(
-            params: ['table_id' => $order['id'], 'table_name' => $this->tableName],
+            params: ['order_no' => $this->orderNo, 'table_name' => $this->tableName],
         );
         if (!empty($bill) && $bill['status'] !== 0) {
             return $this->error('订单已支付');
@@ -205,7 +205,7 @@ class PaymentBusiness extends BusinessResult
 
         $billModel = new BillModel();
         $bill      = $billModel->getDetail(
-            params: ['table_id' => $order['id'], 'table_name' => $this->tableName],
+            params: ['order_no' => $this->orderNo, 'table_name' => $this->tableName],
         );
         if (!empty($bill) && $bill['status'] !== 0) {
             return $this->error('订单已支付');
@@ -268,7 +268,7 @@ class PaymentBusiness extends BusinessResult
 
         $billModel = new BillModel();
         $bill      = $billModel->getDetail(
-            params: ['table_id' => $order['id'], 'table_name' => $this->tableName],
+            params: ['order_no' => $this->orderNo, 'table_name' => $this->tableName],
         );
         if (!empty($bill) && $bill['status'] !== 0) {
             return $this->error('订单已支付');
@@ -331,7 +331,7 @@ class PaymentBusiness extends BusinessResult
 
         $billModel = new BillModel();
         $bill      = $billModel->getDetail(
-            params: ['table_id' => $order['id'], 'table_name' => $this->tableName],
+            params: ['order_no' => $this->orderNo, 'table_name' => $this->tableName],
         );
         if (!empty($bill) && $bill['status'] !== 0) {
             return $this->error('订单已支付');
@@ -392,7 +392,7 @@ class PaymentBusiness extends BusinessResult
 
         $billModel = new BillModel();
         $bill      = $billModel->getDetail(
-            params: ['table_id' => $order['id'], 'table_name' => $this->tableName],
+            params: ['order_no' => $this->orderNo, 'table_name' => $this->tableName],
         );
         if (!empty($bill) && $bill['status'] !== 0) {
             return $this->error('订单已支付');