dever 3 年 前
コミット
96eac6fd54
1 ファイル変更14 行追加2 行削除
  1. 14 2
      app/shop/src/My.php

+ 14 - 2
app/shop/src/My.php

@@ -237,7 +237,10 @@ class My extends Core
             Dever::alert('订单不存在');
         }
         if ($this->data['status'] == 1) {
-            Dever::db('shop/sell_order')->update(array('where_id' => $id, 'status' => 5));
+            $state = Dever::db('shop/sell_order')->update(array('where_id' => $id, 'status' => 5));
+            if ($state) {
+
+            }
 
             return 'ok';
         } else {
@@ -255,7 +258,16 @@ class My extends Core
             Dever::alert('订单不存在');
         }
         if ($this->data['status'] == 2) {
-            Dever::db('shop/sell_order')->update(array('where_id' => $id, 'status' => 6));
+            $state = Dever::db('shop/sell_order')->update(array('where_id' => $id, 'status' => 6));
+            if ($state) {
+                $shop = Dever::db('shop/info')->one($this->data['shop_id']);
+                $msg_param['type'] = 1;//消息类型1是订单消息
+                $msg_param['id'] = $this->data['id'];
+                $msg_param['name'] = $shop['name'];
+                $msg_param = Dever::json_encode($msg_param);
+                $msg = '您有一笔订单已退款,退款将在3个工作日内返回原支付账户';
+                Dever::load('message/lib/data')->push(-1, $this->data['uid'], '退款成功通知', $msg, 1, 1, false, $msg_param);
+            }
 
             # 退款到原支付账户
             return 'ok';