联系官方销售客服
1835022288
028-61286886
接口里回调方法的问题
public function ppp_piccount_data($data) { $rt = []; // 这里根据项目的$data输出格式来定义PHP的数据写法, // 每个接口的写法几乎不一样,下面是测试例子 $keywordsArr = []; if($data['keywords']!='') { $keywordsArr = explode(',',rtrim($data['keywords'],',')); } $img = []; foreach ($data['images'] as $i) { $img[] = dr_get_file($i['file']); } $list = []; if ($data['list']) { foreach ($data['list'] as $t) { $list[] = [ 'author' => $t['author'], 'id' => $t['id'], 'content' => dr_replace_emotion($t['content']), 'support'=>$t['support'], 'avatar'=>dr_avatar($t['uid']), 'inputtime' => dr_date($t['inputtime'], 'Y-m-d H:i:s'), ]; } } $rt[] = [ 'title' => $data['title'], 'id' => $data['id'], 'author'=>$data['author'], 'keywords' => $keywordsArr, 'avatar'=>dr_avatar($data['uid']), 'images' => $img, 'list' => $list, 'updatetime' => dr_date($data['_updatetime'], 'Y-m-d H:i:s'), ]; return $rt; } }
把下面rlist回复按这种格式加入到回调参数里,具体要怎么加进去
{ "id": "41", "cid": "599", "cuid": "6", "uid": "1", "author": "去寻梦", "content": "一级评论[ciya]", "support": "0", "oppose": "0", "avgsort": "0.00", "sort1": "0", "sort2": "0", "sort3": "0", "sort4": "0", "sort5": "0", "sort6": "0", "sort7": "0", "sort8": "0", "sort9": "0", "reply": "0", "in_reply": "1", "status": "1", "inputip": "171.113.123.98", "inputtime": "1599280133", "rlist": [ { "id": "42", "cid": "599", "cuid": "6", "uid": "1", "author": "去寻梦", "content": "2级评论", "support": "0", "oppose": "0", "avgsort": "0.00", "sort1": "0", "sort2": "0", "sort3": "0", "sort4": "0", "sort5": "0", "sort6": "0", "sort7": "0", "sort8": "0", "sort9": "0", "reply": "41", "in_reply": "0", "status": "1", "inputip": "171.113.123.98", "inputtime": "1599280147" }, { "id": "43", "cid": "599", "cuid": "6", "uid": "1", "author": "去寻梦", "content": "3级评论", "support": "0", "oppose": "0", "avgsort": "0.00", "sort1": "0", "sort2": "0", "sort3": "0", "sort4": "0", "sort5": "0", "sort6": "0", "sort7": "0", "sort8": "0", "sort9": "0", "reply": "41", "in_reply": "0", "status": "1", "inputip": "171.113.123.98", "inputtime": "1599280179" } ] } ],