瀏覽代碼

线下酒店等订单增加back_amount

Panda 2 周之前
父節點
當前提交
36a08a16c6

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

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

+ 16 - 0
application/common/model/HotelCanteenOrderModel.php

@@ -19,6 +19,22 @@ class HotelCanteenOrderModel extends BaseModel
     protected $updateTime = false;
     protected $deleteTime = false;
 
+    public function searchUserIdAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('user_id', $value);
+    }
+
+    public function searchOrderNoAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('order_no', $value);
+    }
+
     public function getImageAttr($value, $data)
     {
         return cdnurl($value);

+ 16 - 0
application/common/model/HotelOrderModel.php

@@ -19,6 +19,22 @@ class HotelOrderModel extends BaseModel
     protected $updateTime = false;
     protected $deleteTime = false;
 
+    public function searchUserIdAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('user_id', $value);
+    }
+
+    public function searchOrderNoAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('order_no', $value);
+    }
+
     public function getImageAttr($value, $data)
     {
         return cdnurl($value);

+ 15 - 0
application/common/model/OfflineShopOrderModel.php

@@ -19,6 +19,21 @@ class OfflineShopOrderModel extends BaseModel
     protected $updateTime = false;
     protected $deleteTime = false;
 
+    public function searchUserIdAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('user_id', $value);
+    }
+
+    public function searchOrderNoAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('order_no', $value);
+    }
 
     public function shop()
     {

+ 16 - 0
application/common/model/TravelOrderModel.php

@@ -19,6 +19,22 @@ class TravelOrderModel extends BaseModel
     protected $updateTime = false;
     protected $deleteTime = false;
 
+    public function searchUserIdAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('user_id', $value);
+    }
+
+    public function searchOrderNoAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('order_no', $value);
+    }
+
     public function getImageAttr($value, $data)
     {
         return cdnurl($value);

+ 15 - 0
application/common/model/UniversityEventApplyModel.php

@@ -19,6 +19,21 @@ class UniversityEventApplyModel extends BaseModel
     protected $updateTime = false;
     protected $deleteTime = false;
 
+    public function searchUserIdAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('user_id', $value);
+    }
+
+    public function searchOrderNoAttribute($query, $value, array $params)
+    {
+        if (empty($value)) {
+            return $query;
+        }
+        return $query->where('order_no', $value);
+    }
 
     public function user()
     {