AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
### findCount **计算符合条件的记录数量** **参数** $conditions: 找条件,数组array("字段名"=>"查找值")或字符串, ~~~ public function findCount($conditions = null) { $where = ""; if (is_array ( $conditions )) { $join = array (); foreach ( $conditions as $key => $condition ) { $condition = $this->__val_escape ( $condition ); $join [] = "{$key} = '{$condition}'"; } $where = "WHERE " . join ( " AND ", $join ); } else { if (null != $conditions) $where = "WHERE " . $conditions; } $sql = "SELECT COUNT({$this->pk}) as sp_counter FROM {$this->tbl_name} {$where}"; $result = $this->_db->getArray ( $sql ); return $result [0] ['sp_counter']; } ~~~