联系官方销售客服
1835022288
028-61286886
栏目图片回调求解,将栏目图片转换出来
"hits": "55", "name": { "id": "4", "pid": "1", "pids": "0,1", "name": "女生头像", "dirname": "nstx", "pdirname": "touxiang/", "child": 0, "childids": 4, "thumb": "2745", "show": "1", "setting": { "linkurl": "", "seo": { "l },
public function ppp_list_data($data) { $rt = []; // 这里根据项目的$data输出格式来定义PHP的数据写法, // 每个接口的写法几乎不一样,下面是测试例子 if ($data['list']) { foreach ($data['list'] as $t) { $img = []; foreach ($t['images'] as $i) { $img[] = dr_get_file($i['file']); } $keywordsArr = []; if($t['keywords']!='') { $keywordsArr = explode(',',rtrim($t['keywords'],',')); } $rt[] = [ 'title' => $t['title'], 'id' => $t['id'], 'keywords'=>$keywordsArr, 'comments'=>$t['comments'], 'author'=>$t['author'], 'avatar'=>dr_avatar($t['uid']), 'hits'=>$t['hits'], 'name' => dr_cat_value($t['catid']), 'uid'=>$t['uid'], 'catid'=>$t['catid'], 'comments'=>$t['comments'], 'favorites'=>$t['favorites'], 'support'=>$t['support'], 'thumb' => dr_thumb($t['thumb'], 200, 200), 'updatetime' => dr_fdate($t['_updatetime']), 'images' => $img, ]; } } return $rt; }