接口使用模板标签无缩略图请问如何回调出文章缩略图和所属栏目名 迅睿框架 更新 2020-09-20 21:35:22 西山居 API接口使用模板标签,无缩略图 ,请问如何回调出文章缩略图和所属栏目名称,下图使用模板标签:{module module=news catid=4}调用返回数据没有缩略图项:
把数字转换为图片地址
$return = []; // 返回数据 // 查询新闻列表 $data = \Phpcmf\Service::M()->table('1_news')->where("catid", "4")->getAll(); if ($data) { foreach ($data as $r) { $return[] = [ 'title' => $r['title'], 'thumb' => dr_thumb($r['thumb'], 345, 176), 'description' => $r['description'], 'catname' => dr_cat_value($r['news'], $t.catid, 'name'), ]; } }这样写catname为空,应该怎么写呢'catname' => dr_cat_value('news', $t['catid'], 'name'),