protected function parseOn(&$table, $on)
{
if (empty($on)) {
throw new \InvalidArgumentException(Lang::get('_DB_PARAM_ERROR_PARSE_ON_', $table));
}
$result = '';
foreach ($on as $key => $val) {
if (is_numeric($key)) {
$result == '' || ($result .= ' AND ');
$result .= $val;
} else {
$result == '' || ($result .= $val === true ? ' AND ' : ' OR ');
$result .= $key;
}
}
return addslashes($result);
//on条件是程序员自己写死的表字段名不存在注入以防万一还是过滤一下
}