1, 'wechatAlive' => 1, 'isDeleted' => 0 ]; // 合并额外条件 if (!empty($where)) { $condition = array_merge($condition, $where); } return self::where($condition)->count(); } /** * 获取有登录微信的设备数量 * * @param array $where 额外的查询条件 * @return int 设备数量 */ public static function getDeviceWithWechatCount($where = []) { $condition = [ 'deviceAlive' => 1, 'isDeleted' => 0 ]; // 合并额外条件 if (!empty($where)) { $condition = array_merge($condition, $where); } return self::where($condition)->count(); } }