Pārlūkot izejas kodu

refill_order_manual

xiaoyu 3 gadi atpakaļ
vecāks
revīzija
21edf3659e
1 mainītis faili ar 6 papildinājumiem un 12 dzēšanām
  1. 6 12
      admin/control/refill_order_manual.php

+ 6 - 12
admin/control/refill_order_manual.php

@@ -241,6 +241,7 @@ class refill_order_manualControl extends SystemControl
             {
                 $order_id = intval($order['order_id']);
                 if (algorithm::binary_search($buyback_ids, $order_id)) continue;
+
                 $mchid = $order['mchid'];
                 $merchant_info = $merchants[$mchid];
                 $buyer_id = $order['buyer_id'];
@@ -248,6 +249,11 @@ class refill_order_manualControl extends SystemControl
                 $store_id = $order['store_id'];
                 $provider_info = $providers[$store_id];
                 $account_id = $provider_info['account_id'];
+                if (empty($mchid) || empty($buyer_id) || empty($store_id) || empty($account_id)) {
+                    Log::record("refill order manual err order_id:{$order_id}, order_sn:{$order['order_sn']}");
+                    continue;
+                }
+
                 try
                 {
                     $trans = new trans_wapper($mod_buyback, __METHOD__);
@@ -256,22 +262,10 @@ class refill_order_manualControl extends SystemControl
                         $trans->commit();
                         continue;
                     }
-                    if (empty($mchid) || empty($buyer_id)) {
-                        Log::record("refill order manual merchant err order_id:{$order_id}, order_sn:{$order['order_sn']}");
-                        $trans->commit();
-                        $resp = false;
-                        break;
-                    }
                     $merchant_bz = "机构:{$mchid},订单号:{$order['mch_order']},卡号:{$order['card_no']},返销退款:{$order['mch_amount']}";
                     $this->ct_refill_evidence(['mch_amount' => $order['mch_amount'], 'bz' => $merchant_bz], $merchant_info, $cur_time, $admininfo);
                     $this->credit_save_money($order['mch_amount'], 'add', $buyer_id, $merchant_bz);
 
-                    if (empty($store_id) || empty($account_id)) {
-                        Log::record("refill order manual provider err order_id:{$order_id}, order_sn:{$order['order_sn']}");
-                        $trans->commit();
-                        $resp = false;
-                        break;
-                    }
                     $provider_bz = "通道:{$store_id},椰子单号:{$order['order_sn']},卡号:{$order['card_no']},返销退款:{$order['channel_amount']}";
                     $this->ct_provider_amount(['channel_amount' => $order['channel_amount']], $provider_info, $cur_time, $admininfo);
                     $this->credit_save_money($order['channel_amount'], 'add', $account_id, $provider_bz);