联系官方销售客服
1835022288
028-61286886
关联字段如下定义的:
实现效果:
直接可以访问关联的文章了
回调函数名称:
xb_admin_guanlian
回调函数代码(文件:config/custom.php):
function xb_admin_guanlian($value, $param = [], $data = [], $field = []) { if ($value) { $arr = explode(',', $value); if ($arr) { $value = ''; foreach ($arr as $a) { $a = intval($a); if ($a) { $value.= ','.$a; } } if ($value) { $value = trim($value, ','); $db = \Phpcmf\Service::M()->db->query('select * from '.\Phpcmf\Service::M()->dbprefix(dr_module_table_prefix($field['setting']['option']['module'])).' where id IN ('.$value.') order by instr("'.$value.'", id)'); $mylist = $db ? $db->getResultArray() : []; if ($mylist) { $rt = ''; foreach ($mylist as $t) { $rt.= '<a href="'.dr_url_prefix($t['url']).'">'.$t['title'].'</a> '; } return $rt; } } } } return dr_lang('无'); }
谢谢分享
膜拜大神,学习一下 ,非常感谢