stanley-king 2 лет назад
Родитель
Сommit
3731f64ff2
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      helper/refill/ops/detail_ops.php

+ 13 - 0
helper/refill/ops/detail_ops.php

@@ -70,6 +70,13 @@ class detail_ops
             }
         };
 
+        $modify_state = function ($partition,$detail_id,$state)
+        {
+            if($state > 0) {
+                Model()->table('refill_detail')->update(['detail_id' => $detail_id],['order_state' => $state]);
+            }
+        };
+
         $details = $detail_gen($partition,$start,$last);
         foreach ($details as $item)
         {
@@ -79,6 +86,12 @@ class detail_ops
 
             $state = $state_check($partition,$mchid,$mch_order);
             Log::record("detail_id={$detail_id},mchid={$mchid},mch_order={$mch_order} order_state={$state}",Log::DEBUG);
+            if($state > -1) {
+                $modify_state($partition, $detail_id, $state);
+            }
+            if($state == ORDER_STATE_SEND) {
+                Log::record("SENDING: detail_id={$detail_id},mchid={$mchid},mch_order={$mch_order} order_state={$state}",Log::DEBUG);
+            }
         }
     }
 }