当使用DIY类型字段时,在搜索这个字段时的开发处理,需要定义回调函数
自定义函数文件统一放在/config/custom.php中
函数名称格式:
function dr_diy_field_DIY文件名_search($table, $name, $value, $field) { //$table是当前表名,$name是字段名,$value是搜索值,$field是字段配置的数组 return "新的where条件sql语句"; }
function dr_diy_field_urlrule_search($table, $name, $value, $field) { //$table是当前表名,$name是字段名,$value是搜索值,$field是字段配置的数组 return "新的where条件sql语句"; }当前端搜索模块内容时,url中只要携带了mydiy=xx时,就会触发这个自定义函数。
例如前端地址:
/index.php?s=news&c=search&mydiy=啊啊
文档最后更新时间:2023-08-03 13:05:53