作者 王智

修改

@@ -889,10 +889,14 @@ class User extends Api @@ -889,10 +889,14 @@ class User extends Api
889 $OldList[$k]['Level'] = $v['level']; 889 $OldList[$k]['Level'] = $v['level'];
890 $OldList[$k]['Createtime'] = date('Y-m-d', $v['createtime']); 890 $OldList[$k]['Createtime'] = date('Y-m-d', $v['createtime']);
891 $CountNum = Db::name('money')->where('touser_id', $v['user_id'])->select(); 891 $CountNum = Db::name('money')->where('touser_id', $v['user_id'])->select();
892 - foreach ($CountNum as $key => $value) {  
893 - $Count[] = $value['money']; 892 + if (!empty($CountNum)) {
  893 + foreach ($CountNum as $key => $value) {
  894 + $Count[] = $value['money'];
  895 + }
  896 + $OldList[$k]['CountMoney'] = array_sum($Count);
  897 + } else {
  898 + $OldList[$k]['CountMoney'] = 0;
894 } 899 }
895 - $OldList[$k]['CountMoney'] = array_sum($Count);  
896 } 900 }
897 if ($params['status'] == 1) { 901 if ($params['status'] == 1) {
898 $List = $this->MyTreeAsc($OldList); 902 $List = $this->MyTreeAsc($OldList);