...
|
...
|
@@ -142,7 +142,17 @@ function my_filter($value,$filter=null){ |
|
|
/**
|
|
|
* db 组合条件
|
|
|
* @param array $where
|
|
|
* @param string $ar
|
|
|
* [
|
|
|
* '字段'=>'value',
|
|
|
* '字段.in'=>['value',...],
|
|
|
* '字段.notin'=>['value',...],
|
|
|
* '字段.like'=>'value',
|
|
|
* '字段.not like'=>'value',
|
|
|
* '字段.not in'=>['value',...],
|
|
|
* '字段.between'=>['value',...]
|
|
|
* '_' => 'sql' 或者使用 '_' => ['sql','sql',...]
|
|
|
* ]
|
|
|
* @param string $ar 每个条件之间的连接符号 or/and
|
|
|
* @return string
|
|
|
* @author:dc
|
|
|
* @time 2023/2/17 10:41
|
...
|
...
|
@@ -178,7 +188,10 @@ function dbWhere(array $where, string $ar = 'and'):string{ |
|
|
}
|
|
|
|
|
|
}elseif (count($v) > 1){
|
|
|
$sql[] = "{$f} ".($t=='notin'?'not in':($t?:'in'))." (".implode(',',$v).")";
|
|
|
if($t == 'between'){
|
|
|
$sql[] = "{$f} between '{$v[0]}' and '{$v[1]}'";
|
|
|
}else
|
|
|
$sql[] = "{$f} ".($t=='notin'?'not in':($t?:'in'))." (".implode(',',$v).")";
|
|
|
}
|
|
|
|
|
|
}else{
|
...
|
...
|
|