文件位置:/Users/eric/Documents/DEV/php/webapp/laozhou/jqx/dayrui/Fcms/Core/View.php
mysql語(yǔ)法錯(cuò)誤:
CRITICAL - 2019-09-14 16:20:11 --> Invalid JSON text in argument 1 to function json_extract: "The document is empty." at position 0.
case 'JSON':
if (version_compare(\Phpcmf\Service::M()->db->getVersion(), '5.7.0') < 0) {
// 兼容寫(xiě)法
$string.= $join. " {$t['name']} LIKE \"%\"".\Phpcmf\Service::M()->db->escapeString($t['value'], true)."\"%\"";
} else {
// 高版本寫(xiě)法
$string.= $join." {$t['name']} <>'' AND JSON_CONTAINS ({$t['name']}->'$[*]', '\"".dr_safe_replace($t['value'])."\"', '$')";
}
break;
在使用 JSON_CONTAINS的時(shí)候 必須要判斷當(dāng)前字段是不能為空,否則會(huì)報(bào)錯(cuò)
這個(gè)應(yīng)該是個(gè)bug,發(fā)給官方郵件吧