Your Name 2 years ago
parent
commit
93a0be4696
1 changed files with 10 additions and 3 deletions
  1. 10 3
      service/bill/lib/Sell.php

+ 10 - 3
service/bill/lib/Sell.php

@@ -187,7 +187,14 @@ class Sell
             $member = Dever::db('agent/member')->find($v['mid']);
             $role = Dever::db('setting/role')->find($member['role']);
             $area = Dever::load("area/api.string", $member['area'], '-', true, '');
-            $child = Dever::db('agent/member')->find($v['child_mid']);
+            $child_name = '';
+            $child_mobile = '';
+            if($v['child_mid'] && $v['child_mid'] > 0){
+                $child = Dever::db('agent/member')->find($v['child_mid']);
+                $child_name = $child['name'];
+                $child_mobile = $child['mobile'];
+            }
+            
             $cdate = '-';
             if($v['cdate']){
                 $cdate = date('Y-m-d H:i',$v['cdate']);
@@ -198,8 +205,8 @@ class Sell
                 $member['mobile'],
                 $role['name'],
                 $area,
-                $child['name'],
-                $child['mobile'],
+                $child_name,
+                $child_mobile,
                 $v['num'],
                 $cdate,
             );