dever 4 years ago
parent
commit
e74a2b9b39
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/Pay.php

+ 3 - 1
lib/Pay.php

@@ -66,7 +66,7 @@ class Pay
             $price += $order_data['freight_price'];
         }
         $order_data['price'] = $price;
-        $order_data['reward'] = $goods['reward'];
+        $order_data['reward'] = isset($goods['reward']) && $goods['reward'] ? $goods['reward'] : 0;
         $order_data['system_source'] = $system_source;
         $order_data['order_id'] = $this->getOrderId();
         $id = Dever::db('goods/order')->insert($order_data);
@@ -141,6 +141,7 @@ class Pay
                 # 增加积分
                 if ($order['parent_uid'] > 0 && $order['parent_uid'] != $order['uid']) {
                     $uid = $order['parent_uid'] . '_' . $order['uid'];
+                    # 给上级发佣金
                     Dever::score($order['parent_uid'], 'sell_my_goods', '销售自营商品', false, $order['reward'], false, $order['type'], $order['type_id']);
                 } else {
                     $uid = $order['uid'];
@@ -150,6 +151,7 @@ class Pay
                 if (Dever::project('collection')) {
                     Dever::load('collection/lib/ranking')->up($order['uid'], $order['type_id'], 2, $order['num']);
                 }
+                # 给自己发佣金
                 Dever::score($uid, 'buy_my_goods', '购买自营商品', false, $order['reward'], false, $order['type'], $order['type_id']);
 
                 # 发消息