Authored by Rock Zhang

修复数据为空会报错的bug

@@ -32,7 +32,7 @@ class HomeController extends AbstractAction @@ -32,7 +32,7 @@ class HomeController extends AbstractAction
32 } 32 }
33 33
34 $action = $this->getRequest()->getActionName(); 34 $action = $this->getRequest()->getActionName();
35 - if (!$this->_uid && $action !== 'index' && $this->isAjax()) { 35 + if (!$this->_uid && $action !== 'index' && !$this->isAjax()) {
36 $this->go(Helpers::url('/signin.html')); 36 $this->go(Helpers::url('/signin.html'));
37 } 37 }
38 38
@@ -33,7 +33,7 @@ class UserModel @@ -33,7 +33,7 @@ class UserModel
33 $userData = UserData::userData($uid); 33 $userData = UserData::userData($uid);
34 34
35 // 处理个人详情数 35 // 处理个人详情数
36 - if (!isset($userData['code'])) { 36 + if ($userData && !isset($userData['code'])) {
37 $result = $userData; 37 $result = $userData;
38 $result['gender'] = $result['gender'] == 1 ? '男' : '女'; 38 $result['gender'] = $result['gender'] == 1 ? '男' : '女';
39 $result['head_ico'] = $result['head_ico'] ? Images::getImageUrl($result['head_ico'], 128, 128) : ''; 39 $result['head_ico'] = $result['head_ico'] ? Images::getImageUrl($result['head_ico'], 128, 128) : '';
@@ -103,7 +103,7 @@ class UserModel @@ -103,7 +103,7 @@ class UserModel
103 } 103 }
104 // 有货币数量 104 // 有货币数量
105 $coinNum = UserData::yohoCoinData($uid); 105 $coinNum = UserData::yohoCoinData($uid);
106 - if(!isset($coinNum['code'])) { 106 + if($coinNum && !isset($coinNum['code'])) {
107 $result['yoho_coin_num'] = $coinNum; 107 $result['yoho_coin_num'] = $coinNum;
108 } 108 }
109 109
@@ -354,7 +354,7 @@ class UserModel @@ -354,7 +354,7 @@ class UserModel
354 $address = UserData::addressData($uid); 354 $address = UserData::addressData($uid);
355 355
356 // 处理地址数据 356 // 处理地址数据
357 - if (!isset($address['code'])) { 357 + if ($address && !isset($address['code'])) {
358 $result = $address; 358 $result = $address;
359 } 359 }
360 360