rabin 1 year ago
parent
commit
11ec75ba8a

+ 46 - 0
src/dai/seller/api/Manage.php

@@ -57,6 +57,52 @@ class Manage extends Auth
         return '回调发送成功';
     }
 
+    public function sendCallBack1()
+    {
+        $id = Dever::input('id');
+        if ($id) {
+            $where['id'] = array('in', $id);
+            $order = Dever::db('order_log1', 'seller')->select($where);
+            foreach ($order as $k => $v) {
+                $msg = '';
+                if ($v['status'] == 10) {
+                    $msg = 'ok';
+                } elseif ($v['status'] == 11) {
+                    $msg = 'error';
+                }
+                if ($msg) {
+                    Dever::load('order', 'seller')->notify($v, $msg, array(), 1000);
+                }
+            }
+        } else {
+            Dever::error('请选择发回调的订单');
+        }
+        return '回调发送成功';
+    }
+
+    public function sendCallBack2()
+    {
+        $id = Dever::input('id');
+        if ($id) {
+            $where['id'] = array('in', $id);
+            $order = Dever::db('order_log2', 'seller')->select($where);
+            foreach ($order as $k => $v) {
+                $msg = '';
+                if ($v['status'] == 10) {
+                    $msg = 'ok';
+                } elseif ($v['status'] == 11) {
+                    $msg = 'error';
+                }
+                if ($msg) {
+                    Dever::load('order', 'seller')->notify($v, $msg, array(), 1000);
+                }
+            }
+        } else {
+            Dever::error('请选择发回调的订单');
+        }
+        return '回调发送成功';
+    }
+
     # 获取商品
     public function getGoods($value = false)
     {

+ 5 - 1
src/dai/seller/lib/Manage.php

@@ -166,7 +166,11 @@ class Manage extends Auth
         foreach ($id as $k => $v) {
             $info = Dever::db('order', 'seller')->find($v);
             if ($info['status'] >= 10) {
-                Dever::load('order', 'seller')->finish($info, 2);
+                $msg = 'error';
+                if ($info['status'] == 10) {
+                    $msg = 'ok';
+                }
+                Dever::load('order', 'seller')->notify($info, $msg);
             }
         }
     }

+ 1 - 1
src/dai/seller/table/manage/order_log2_list.php

@@ -6,7 +6,7 @@ unset($config['list']['stat']);
 unset($config['list']['button']);
 $config['list']['button'] = array
 (
-
+    '发回调' => array('api', 'seller/manage.sendCallBack2'),
 );
 $config['list']['field']['status']['remote'] = 'seller/manage.showOrderLog2Expand';
 

+ 1 - 0
src/dai/seller/table/manage/order_log_list.php

@@ -6,6 +6,7 @@ unset($config['list']['button']);
 $config['list']['button'] = array
 (
     '更改订单状态' => array('oper', 'status'),
+    '发回调' => array('api', 'seller/manage.sendCallBack1'),
 );
 $config['source'] = 'seller/order_log1';
 $config['list']['field']['status']['remote'] = 'seller/manage.showOrderLogExpand';