Parcourir la source

修改人工充值

lip il y a 3 heures
Parent
commit
cf9e9c1afd

+ 4 - 1
app/Http/Controllers/admin/PaymentOrder.php

@@ -31,7 +31,10 @@ class PaymentOrder extends Controller
             $count = PaymentOrderModel::whereIn('id', $params['ids'])->where('payment_type', $params['payment_type'])->where('status', 0)->count();
             if ($count != count($params['ids'])) throw new Exception('数据匹配异常,请刷新页面重试!', HttpStatus::CUSTOM_ERROR);
             
-            PaymentOrderModel::whereIn('id', $params['ids'])->where('payment_type', $params['payment_type'])->where('status', 0)->update(['pay_data' => $params['pay_data']]);
+            PaymentOrderModel::whereIn('id', $params['ids'])
+                ->where('payment_type', $params['payment_type'])
+                ->where('status', 0)
+                ->update(['pay_data' => $params['pay_data'], 'status' => 1]);
 
             DB::commit();
         } catch (ValidationException $e) {

+ 6 - 6
app/Services/PaymentOrderService.php

@@ -56,11 +56,14 @@ class PaymentOrderService extends BaseService
         if (isset($search['member_id']) && !empty($search['member_id'])) {
             $where[] = ['payment_orders.member_id', '=', $search['member_id']];
         }
-        if (isset($search['type']) && !empty($search['type'])) {
-            $where[] = ['payment_orders.type', '=', $search['type']];
-        }
         if (isset($search['channel']) && !empty($search['channel'])) {
             $where[] = ['payment_orders.channel', '=', $search['channel']];
+            if ($search['channel'] == 'rgcz') {
+                $search['type'] = 3;
+            }
+        }
+        if (isset($search['type']) && !empty($search['type'])) {
+            $where[] = ['payment_orders.type', '=', $search['type']];
         }
         if (isset($search['order_no']) && !empty($search['order_no'])) {
             $where[] = ['payment_orders.order_no', '=', $search['order_no']];
@@ -77,9 +80,6 @@ class PaymentOrderService extends BaseService
         if (isset($search['payment_type']) && $search['payment_type'] != '') {
             $where[] = ['payment_orders.payment_type', '=', $search['payment_type']];
         }
-        if (isset($search['channel']) && $search['channel'] != '') {
-            $where[] = ['payment_orders.channel', '=', $search['channel']];
-        }
         return $where;
     }