作者 邓超

x

... ... @@ -358,6 +358,17 @@ class MailListV2 extends Base {
public function count(){
// $emails = $this->getEmails('id');
// 时间 必须是数组
$udate = app()->request('udate');
if($udate && is_array($udate) && count($udate) == 2){
$udate = array_values($udate);
$where['udate.between'] = array_map(function ($v){
if(is_numeric($v)) return $v;
return strtotime($v);
},$udate);
}
// show_count_filed
$show_count_filed = app()->requestArr('show_count_filed',['inbox', 'send', 'unseen', 'flagged', 'junk', 'hot_inbox', 'hot_send']);
... ...
... ... @@ -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{
... ...