rabin 2 years ago
parent
commit
908330d4cf
1 changed files with 12 additions and 7 deletions
  1. 12 7
      service/agent/lib/Order.php

+ 12 - 7
service/agent/lib/Order.php

@@ -1741,7 +1741,7 @@ class Order
 
         $db = Dever::db('agent/test:old');
 
-        $header = array('姓名', '手机号', '身份证号', '注册日期', '角色', '代理金额', '直推奖励合计');
+        $header = array('姓名', '手机号', '身份证号', '注册日期', '角色', '代理金额', '直推奖励合计', '直推月度奖励');
 
         $body = array();
         foreach($data as $k => $v){
@@ -1761,6 +1761,7 @@ class Order
             if ($info) {
                 $cash = $info['total'];
             }
+            $month_cash = array();
 
             if ($v['mid'] < 50000) {
                 $member = $db->fetch('select * from ims_ewei_shop_member where id = ' . $v['mid'] . '');
@@ -1785,6 +1786,12 @@ class Order
                         if ($total > 0) {
                             $cash += $total;
                         }
+
+                        if (isset($month) && $month) {
+                            foreach ($month as $k2 => $v2) {
+                                $month_cash[] = $k2 . ':' . $v2;
+                            }
+                        }
                     }
                 }
             }
@@ -1792,6 +1799,8 @@ class Order
             if (!$cash) {
                 $cash = 0;
             }
+
+            $month_cash = implode(',', $month_cash);
             
             $d = array
             (
@@ -1802,13 +1811,9 @@ class Order
                 $role_name,
                 $v['agent_cash'],
                 $cash,
+                $month_cash,
             );
-            if (isset($month) && $month) {
-                foreach ($month as $k2 => $v2) {
-                    $header[] = $k2 . '直推奖励';
-                    $d[] = $v2;
-                }
-            }
+            
             $body[] = $d;
         }
         $file = Dever::input('excel_name');