stanley-king il y a 3 ans
Parent
commit
b61cb85890
1 fichiers modifiés avec 18 ajouts et 11 suppressions
  1. 18 11
      admin/control/refill_order_manual.php

+ 18 - 11
admin/control/refill_order_manual.php

@@ -199,19 +199,28 @@ class refill_order_manualControl extends SystemControl
         $admininfo = $this->getAdminInfo();
         $bz = empty($bz) ? '' : $bz;
 
-        $buyback_ids = function ($order_ids,$oper_type){
-            $buybacks = Model('refill_buyback')->getBuyBackList(['order_id' => ['in',$order_ids], 'manual_type' => $oper_type]);
+        $buyback_ids = function ($order_ids, $oper_type) {
+            $buybacks = Model('refill_buyback')->getBuyBackList(['order_id' => ['in', $order_ids], 'manual_type' => $oper_type]);
             $buyback_ids = array_column($buybacks, 'order_id');
             $buyback_ids = $this->int_array($buyback_ids);
             return $this->unique_array($buyback_ids);
         };
 
-        $insert_item = function ($order, $oper_type, $admininfo, $cur_time, $bz){
-            return [ 'order_id' => $order['order_id'], 'order_sn' => $order['order_sn'], 'order_time' => $order['order_time'], 'notify_time' => $order['notify_time'],
-                'manual_type' => $oper_type, 'admin_id' => $admininfo['id'], 'admin_name' => $admininfo['name'], 'act_time' => $cur_time, 'bz' => $bz];
+        $insert_item = function ($order, $oper_type, $admininfo, $cur_time, $bz)
+        {
+            return ['order_id' => $order['order_id'],
+                'order_sn' => $order['order_sn'],
+                'order_time' => $order['order_time'],
+                'notify_time' => $order['notify_time'],
+                'manual_type' => $oper_type,
+                'admin_id' => $admininfo['id'],
+                'admin_name' => $admininfo['name'],
+                'act_time' => $cur_time,
+                'bz' => $bz];
         };
 
-        if($oper_type == 'buyback') {
+        if($oper_type == 'buyback')
+        {
             $mchids = array_column($orders, 'mchid');
             $mchids = $this->unique_array($mchids);
             $merchant_list = $this->merchants(['mchid' => ['in', $mchids]]);
@@ -226,11 +235,12 @@ class refill_order_manualControl extends SystemControl
             }
         }
 
+        $mod_buyback = Model('refill_buyback');
         $buyback_ids = $buyback_ids($order_ids, $oper_type);
+        $fetch_order_ids = $this->check_fetch_order($order_ids);
+        $fetch_order_ids = $this->unique_array($fetch_order_ids);
 
         $cur_time = time();
-        $mod_buyback = Model('refill_buyback');
-
         if($oper_type == 'buyback')
         {
             foreach ($orders as $order)
@@ -285,9 +295,6 @@ class refill_order_manualControl extends SystemControl
         }
         else
         {
-            $fetch_order_ids = $this->check_fetch_order($order_ids);
-            $fetch_order_ids = $this->unique_array($fetch_order_ids);
-
             foreach ($orders as $order)
             {
                 $order_id = intval($order['order_id']);