stanley-king před 4 roky
rodič
revize
a75e8d8b1d

+ 0 - 13
admin/control/merchant.php

@@ -792,14 +792,7 @@ class merchantControl extends SystemControl
     {
         $model_refill_order = Model('refill_order');
         $condition['refill_order.inner_status'] = 0;
-<<<<<<< HEAD
 
-        $condition['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
-        if($_GET['order_state'] == ORDER_STATE_SEND) {
-            unset($condition['refill_order.order_time']);
-        }
-=======
->>>>>>> 1de126e5d3206897880a77c3e9c76394d5ba526d
         if (!empty($_GET['order_sn'])) {
             $condition['refill_order.order_sn'] = $_GET['order_sn'];
         }
@@ -838,16 +831,10 @@ class merchantControl extends SystemControl
         }
 
         $start_unixtime = strtotime($_GET['query_start_time']);
-<<<<<<< HEAD
-        $end_unixtime   = strtotime($_GET['query_end_time']);
-        if ($start_unixtime > 0 && $end_unixtime > 0) {
-            $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
-=======
         $end_unixtime = strtotime($_GET['query_end_time']);
 
         if ($start_unixtime >0 && $end_unixtime >0) {
             $condition['refill_order.order_time'] = ['between', [$start_unixtime, $end_unixtime]];
->>>>>>> 1de126e5d3206897880a77c3e9c76394d5ba526d
         }
 
         if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40']))

+ 1 - 13
data/logic/queue.logic.php

@@ -1415,20 +1415,8 @@ class queueLogic
             return callback(false, 'QueryRefillState 参数order_id错误');
         }
         else {
-            refill\util::push_notify_merchant($order_id,$manual);
+            refill\util::push_query($order_id);
             return callback(true, '成功放入通知队列', ['order_id' => $order_id]);
         }
-
-        $order_id = intval($params['order_id']);
-        refill\util::push_query($params);
-
-
-        if($order_id <= 0) {
-            return callback(false);
-        }
-        $success = refill\RefillFactory::instance()->query($order_id);
-        if($success) {
-            return callback(true, '', ['order_id' => $order_id]);
-        }
     }
 }

+ 1 - 1
helper/refill/RefillBase.php

@@ -431,7 +431,7 @@ class RefillBase
 
                 if($modify_able) {
                     $mod_refill->edit($order_id, ['notify_time' => time(), 'notify_state' => 1]);
-                    QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
+                    QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => true]);
                 }
             }
 

+ 2 - 3
rdispatcher/dispatcher.php

@@ -57,6 +57,5 @@ function work_proc()
 }
 
 //refill\RefillFactory::instance();
-work_proc();
-
-//event\util::fork_workerex('work_proc',$count);
+//work_proc();
+event\util::fork_workerex('work_proc',$count);

+ 15 - 5
rdispatcher/processor.php

@@ -21,10 +21,9 @@ class processor extends queue\ILooper
         {
             foreach ($msg as $key => $params)
             {
-                Log::record("start one", Log::DEBUG);
                 if (empty($params)) continue;
-
                 $method = strtolower($key);
+                Log::record("processor hanlde method={$method}", Log::DEBUG);
                 try
                 {
                     if ($method == 'add') {
@@ -37,10 +36,21 @@ class processor extends queue\ILooper
                         if(empty($channel) || empty($params))
                             return;
                         $this->mProxy->notify($channel,$input);
-                    } else {
-                        Log::record("Error msg", Log::DEBUG);
                     }
-                } catch (Exception $x) {
+                    elseif($method == 'notify_mechant') {
+                        $order_id = intval($params['order_id']);
+                        $manual = $params['manual'] ?? false;
+                        $this->mProxy->notify_merchant($order_id,$manual);
+                    }
+                    elseif($method == 'query') {
+                        $order_id = intval($params['order_id']);
+                        $this->mProxy->query($order_id);
+                    }
+                    else {
+                        Log::record("Error Method={$method}", Log::DEBUG);
+                    }
+                }
+                catch (Exception $x) {
                     Log::record($x->getMessage(), Log::ERR);
                 }
             }

+ 11 - 2
rdispatcher/proxy.php

@@ -68,7 +68,7 @@ class proxy
 
     private function latest_order($refill_order,$mchid,$mch_order)
     {
-        $orders = $refill_order->getOrderInfo(['mchid' => $mchid,'mch_order' => $mch_order]);
+        $orders = $refill_order->getMerchantOrderList(['mchid' => $mchid,'mch_order' => $mch_order]);
         if(empty($orders)) {
             return [];
         }
@@ -79,6 +79,15 @@ class proxy
 
     public function notify($channel,$input)
     {
-        refill\RefillFactory::instance()->notify($channel,$input);
+        return refill\RefillFactory::instance()->notify($channel,$input);
+    }
+
+    public function notify_merchant($order_id,$manual)
+    {
+        return refill\RefillFactory::instance()->notify_merchant($order_id,$manual);
+    }
+    public function query($order_id)
+    {
+        return refill\RefillFactory::instance()->query($order_id);
     }
 }