本文整理汇总了PHP中CUser::countList方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::countList方法的具体用法?PHP CUser::countList怎么用?PHP CUser::countList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::countList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
*/
CCanDo::checkRead();
/** @var int $times */
$times = CView::get("times", "num notNull pos max|100 default|20");
/** @var int $duration */
$duration = CView::get("duration", "num notNull pos max|60 default|1");
/** @var bool $do */
$do = CView::get("do", "bool");
CView::checkin();
CView::enforceSlave();
$reports = array();
$error_reporting = error_reporting(0);
if ($do) {
$steps = $times;
while ($steps--) {
// dummy query
$user = new CUser();
$user->countList();
$ds = $user->getDS();
$reports[] = array("time" => CMbDT::time(), "dsn" => $ds->dsn, "errno" => $ds->errno(), "error" => $ds->error());
sleep($duration);
}
}
error_reporting($error_reporting);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("times", $times);
$smarty->assign("duration", $duration);
$smarty->assign("do", $do);
$smarty->assign("reports", $reports);
$smarty->display("slave_tester.tpl");
示例2: CUser
$count = CValue::get("count", 5);
$group_id = CGroups::loadCurrent()->_id;
$user = new CUser();
// Requêtes
$ljoin["id_sante400"] = "`id_sante400`.`object_id` = `users`.`user_id`";
$ljoin["users_mediboard"] = "`users`.`user_id` = `users_mediboard`.`user_id`";
$ljoin["functions_mediboard"] = "`functions_mediboard`.`function_id` = `users_mediboard`.`function_id`";
$where = array();
$where["id_sante400.object_class"] = "= 'CUser'";
$where["id_sante400.tag"] = "= '" . CAppUI::conf("admin LDAP ldap_tag") . "'";
$where["id_sante400.id400"] = "IS NOT NULL";
$where["users.template"] = "= '0'";
$where["users_mediboard.actif"] = "= '1'";
$where["functions_mediboard.group_id"] = "= '{$group_id}'";
if (!$do_import) {
$count_users_ldap = $user->countList($where, null, $ljoin);
$ljoin = array();
$ljoin["users_mediboard"] = "`users`.`user_id` = `users_mediboard`.`user_id`";
$ljoin["functions_mediboard"] = "`functions_mediboard`.`function_id` = `users_mediboard`.`function_id`";
$where = array();
$where["users.template"] = "= '0'";
$where["users_mediboard.actif"] = "= '1'";
$where["functions_mediboard.group_id"] = "= '{$group_id}'";
$count_users_all = $user->countList($where, null, $ljoin);
CAppUI::stepAjax($count_users_all - $count_users_ldap . " comptes qui ne sont pas associés");
} else {
$ldaprdn = CAppUI::conf("admin LDAP ldap_user");
$ldappass = CAppUI::conf("admin LDAP ldap_password");
// Récupération de la liste des comptes qui ne sont pas associés
$users_ldap = $user->loadList($where, null, null, null, $ljoin);
$ljoin = array();
示例3: while
while ($line = fgetcsv($fp, null, ";")) {
if (!isset($line[0]) || $line[0] == "") {
continue;
}
$results[$i]["error"] = 0;
// Parsing
$results[$i]["adeli"] = addslashes(trim($line[0]));
$results[$i]["idex"] = addslashes(trim($line[1]));
$results[$i]["lastname"] = isset($line[2]) ? addslashes(trim($line[2])) : null;
$results[$i]["firstname"] = isset($line[3]) ? addslashes(trim($line[3])) : null;
$user = new CUser();
$ljoin["users_mediboard"] = "users_mediboard.user_id = users.user_id";
$ljoin["functions_mediboard"] = "functions_mediboard.function_id = users_mediboard.function_id";
$where = array("users_mediboard.adeli" => " = '" . $results[$i]["adeli"] . "'", "functions_mediboard.group_id" => " = '{$group_id}'");
$user = new CUser();
$count = $user->countList($where, null, $ljoin);
if ($count == 0) {
$results[$i]["error"] = "L'utilisateur n'a pas été retrouvé dans Mediboard";
$i++;
continue;
} elseif ($count > 1) {
$results[$i]["error"] = "Plusieurs utilisateurs correspondent à cette recherche";
$i++;
continue;
}
$user->loadObject($where, null, null, $ljoin);
$mediuser = $user->loadRefMediuser();
// Recherche pas nom/prenom si pas de code ADELI
if (!$mediuser->_id) {
$user = new CUser();
$user->user_last_name = $results[$i]["lastname"];