嗨,我有一个功能是:
public function getpopularAction()
{
$businessReviewMapper = new Application_Model_Mapper_BusinessReviewsMapper();
$result = $businessReviewMapper->getTotalPopular();
for ($i = 0; $i < count($result); $i++)
{
$rotd[$i] = $businessReviewMapper->getROTD($result[$i]['review_id']);
for ($j = 0; $j < count($rotd); $j++)
{
$rotd[$j]['u_img'] = $this->view->getLoginUserImage(
$rotd[$j]['social_id'], $rotd[$j]['login_type'], null, null, large
);
}
}
print_r($rotd);
exit;
}
我得到的结果是:
Array
(
[0] => Array
(
[0] => Array
(
[review_id] => 161
[review_desc] => tgi goooood....................
[user_id] => 2
[rating] => 3
[review_date] => 20121022203529
[name] => zlippr
[social_id] => 12345678
[login_type] => facebook
[user_unique_name] => zlippr
[city] => Kuala Lumpur
[business_name] => TGI Friday Kuala Lumpur
)
[u_img] => /public/images/image_not_found.png
)
)
我不知道问题出在哪里,但是u_img没有正确获取,不确定数组循环是否正确执行。