作者 anyv
1 个管道 的构建 通过 耗费 0 秒

5

@@ -524,22 +524,22 @@ class PersonalcenterController extends WeChatBaseController{ @@ -524,22 +524,22 @@ class PersonalcenterController extends WeChatBaseController{
524 }else{ 524 }else{
525 $data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray(); 525 $data[$key] = Db::name('indent') -> where('uid',$val['uid']) -> where("state = 2 or state = 3 or state = 5") -> select() -> toArray();
526 } 526 }
527 -  
528 -  
529 $name = $val['user_nickname']; 527 $name = $val['user_nickname'];
530 $avatar = $val['avatar']; 528 $avatar = $val['avatar'];
531 - foreach ($data[$key] as $key1 => $val1){  
532 - $book_name = Db::name('indent_goods') -> where("indent_id",$val1['id']) -> find();  
533 - $data[$key][$key1]['user_name'] = $name;  
534 - $data[$key][$key1]['avatar'] = $avatar;  
535 - $data[$key][$key1]['book_name'] = $book_name['book_name'];  
536 - $money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray();  
537 - $money = 0;  
538 - foreach ($money_income as $key2 => $val2){  
539 - $money += $val2['money']; 529 + if(count($data[$key])!=0){
  530 + foreach ($data[$key] as $key1 => $val1){
  531 + $book_name = Db::name('indent_goods') -> where("indent_id",$val1['id']) -> find();
  532 + $data[$key][$key1]['user_name'] = $name;
  533 + $data[$key][$key1]['avatar'] = $avatar;
  534 + $data[$key][$key1]['book_name'] = $book_name['book_name'];
  535 + $money_income = Db::name('money_income') -> where("indent_id =".$val1['id']." and uid = ".$uid) -> select() -> toArray();
  536 + $money = 0;
  537 + foreach ($money_income as $key2 => $val2){
  538 + $money += $val2['money'];
  539 + }
  540 + $data[$key][$key1]['total_money'] = $money;
  541 + $res[] = $data[$key][$key1];
540 } 542 }
541 - $data[$key][$key1]['total_money'] = $money;  
542 - $res[] = $data[$key][$key1];  
543 } 543 }
544 544
545 } 545 }