当前位置: 首页>>代码示例>>PHP>>正文


PHP CUser::countList方法代码示例

本文整理汇总了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");
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:slave_tester.php

示例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();
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:ajax_ldap_massive_import.php

示例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"];
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:user_idex_csv.php


注:本文中的CUser::countList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。