Showing
1 changed file
with
10 additions
and
8 deletions
@@ -383,15 +383,17 @@ class UserModel | @@ -383,15 +383,17 @@ class UserModel | ||
383 | // 调用接口获取YOHO币 | 383 | // 调用接口获取YOHO币 |
384 | $yohoCoin = UserData::yohoCoinData($uid, $page, $limit, 'post'); | 384 | $yohoCoin = UserData::yohoCoinData($uid, $page, $limit, 'post'); |
385 | // 处理YOHO币数据 | 385 | // 处理YOHO币数据 |
386 | - $coinList = $yohoCoin['data']['coinlist']; | ||
387 | - $data['money'] = $yohoCoin['data']['total']; | ||
388 | - foreach($coinList as $key => $val){ | ||
389 | - $result[$key]['title'] = $val['message']; | ||
390 | - $result[$key]['time'] = $val['date']; | ||
391 | - if($val['num'] > 0){ | ||
392 | - $val['num'] = '+'.$val['num']; | 386 | + if(isset($yohoCoin['data']) && !empty($yohoCoin['data'])){ |
387 | + $coinList = $yohoCoin['data']['coinlist']; | ||
388 | + $data['money'] = $yohoCoin['data']['total']; | ||
389 | + foreach($coinList as $key => $val){ | ||
390 | + $result[$key]['title'] = $val['message']; | ||
391 | + $result[$key]['time'] = $val['date']; | ||
392 | + if($val['num'] > 0){ | ||
393 | + $val['num'] = '+'.$val['num']; | ||
394 | + } | ||
395 | + $result[$key]['count'] = $val['num']; | ||
393 | } | 396 | } |
394 | - $result[$key]['count'] = $val['num']; | ||
395 | } | 397 | } |
396 | $data['list'] = $result; | 398 | $data['list'] = $result; |
397 | return $data; | 399 | return $data; |
-
Please register or login to post a comment