码迷,mamicode.com
首页 > Web开发 > 详细

获取评论相关的字段值一段php代码

时间:2016-11-06 00:01:12      阅读:398      评论:0      收藏:0      [点我收藏+]

标签:api 接口 评论




public function getEvaluateGoodsListInfoForPage($condition, $page = null, $count = 0, $order = ‘geval_id desc‘, $field = ‘*‘) {

 $list = $this->field($field)->where($condition)->page($page, $count)->order($order)->select();

  /* $model = Model();
   $field = ‘member.member_avatar,evaluate_goods.*‘;
   $on = ‘evaluate_goods.geval_frommemberid=member.member_id‘;
   $list= $model->table(‘evaluate_goods,member‘)->field($field)->join(‘left‘)->on($on)->where($condition)->page(10)->order($order)->select();*/

   foreach ($list as $key => $_val) {
       $list[$key][‘geval_frommemberid_avatar‘] = getMemberAvatarForID($_val[‘geval_frommemberid‘]);
       $list[$key][‘geval_image‘] = array();
    //   $list[$key][‘geval_frommemberavatar‘]= getMemberAvatar($_val[‘member_avatar‘]);

       if ($_val[‘geval_image‘]) {
           $image_array = explode(‘,‘, $_val[‘geval_image‘]);
           foreach ($image_array as $_key => $value) {
               $list[$key][‘geval_image‘][$_key] = snsThumb($value,240);
           }
       }
       $list[$key][‘geval_remark‘] = $list[$key][‘geval_remark‘]?$list[$key][‘geval_remark‘]:"";
       $list[$key][‘geval_explain‘] = $list[$key][‘geval_explain‘]?$list[$key][‘geval_explain‘]:"";
   }

   return $list;
}


获取评论相关的字段值一段php代码

标签:api 接口 评论

原文地址:http://phpervip.blog.51cto.com/11075781/1869827

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!