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


PHP Logs::count_all方法代码示例

本文整理汇总了PHP中Logs::count_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Logs::count_all方法的具体用法?PHP Logs::count_all怎么用?PHP Logs::count_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Logs的用法示例。


在下文中一共展示了Logs::count_all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: draw

 function draw()
 {
     $user_ids = Url::get('id');
     global $display;
     //        $this->beginForm(false, 'post', false, Url::build_current(array('cmd' => 'history_lesson')));
     $filter_id = intval(trim(Url::get('filter_id')));
     $sid = intval(trim(Url::get('subject')));
     $display->add('from_time', Url::get('from_time'));
     $display->add('to_time', Url::get('to_time'));
     $display->add('subject', $sid);
     $list_subject = Subjects::get_collection(null);
     if (!empty($sid)) {
         $list_lesson = Lessons::get_collection(null, ' subject = ' . $sid);
     } else {
         $list_lesson = Lessons::get_collection(null);
     }
     $display->add('list_subject', $list_subject);
     $display->add('list_lesson', $list_lesson);
     $cond = array();
     if (!empty($filter_id)) {
         $cond[] = 'id LIKE "%' . $filter_id . '%"';
         $display->add('filter_id', $filter_id);
     }
     $from_time = 0;
     $to_time = 0;
     if (Url::get('from_time')) {
         $date_arr = explode('/', Url::get('from_time'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $from_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 0);
         }
     }
     if (Url::get('to_time')) {
         $date_arr = explode('/', Url::get('to_time'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $to_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 1);
         }
     }
     if ($from_time) {
         $cond[] = ' `time` >= ' . $from_time;
     }
     if ($to_time) {
         $cond[] = ' `time` <= ' . $to_time;
     }
     $cond[] = 'uid = ' . $user_ids;
     $cond[] = 'type_id = 1';
     $str_lesson = '';
     foreach ($list_lesson as $lesson) {
         $str_lesson .= $str_lesson == '' ? $lesson['id'] : ', ' . $lesson['id'];
     }
     $cond[] = ' object_id IN (' . $str_lesson . ') ';
     $item_per_page = 50;
     $cond = EClassApi::analyze_conditions($cond);
     $list_user_log = array();
     $paging = '';
     $total_row = Logs::count_all($cond);
     if ($total_row) {
         require_once ROOT_PATH . 'core/ECPagging.php';
         $limit = '';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $list_user_log = Logs::get_collection($limit, $cond, 'ORDER BY id DESC');
     }
     $error_message = $this->getErrorMessage('admin/category/error');
     $display->add('error_message', $error_message);
     $display->add('paging', $paging);
     $display->add('user_ids', $user_ids);
     $display->add('list_user_log', $list_user_log);
     $display->add('is_admin', User::is_admin());
     $display->output('history');
     //        $this->endForm();
 }
开发者ID:hqd276,项目名称:bigs,代码行数:70,代码来源:History.php

示例2: draw

 function draw()
 {
     global $display;
     //        $this->beginForm(false, 'post', false, Url::build_current(array('cmd' => 'list_log')));
     $filter_id = intval(trim(Url::get('filter_id')));
     $filter_type = intval(trim(Url::get('filter_type')));
     $display->add('from_time', Url::get('from_time'));
     $display->add('to_time', Url::get('to_time'));
     $cond = array();
     if (!empty($filter_id)) {
         $cond[] = 'a.id LIKE "' . $filter_id . '"';
         $display->add('filter_id', $filter_id);
     }
     $from_time = 0;
     $to_time = 0;
     if (Url::get('from_time')) {
         $date_arr = explode('/', Url::get('from_time'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $from_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 0);
         }
     }
     if (Url::get('to_time')) {
         $date_arr = explode('/', Url::get('to_time'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $to_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 1);
         }
     }
     if ($from_time) {
         $cond[] = ' `time` >= ' . $from_time;
     }
     if ($to_time) {
         $cond[] = ' `time` <= ' . $to_time;
     }
     $cond[] = ' type_id = -1 ';
     $item_per_page = 50;
     $cond = EClassApi::analyze_conditions($cond);
     $list_log = array();
     $paging = '';
     $total_row = Logs::count_all($cond);
     if ($total_row) {
         require_once ROOT_PATH . 'core/ECPagging.php';
         $limit = '';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $list_log = Logs::get_collection($limit, $cond, ' ORDER BY id DESC');
         foreach ($list_log as $k => $l) {
             $l['data'] = unserialize($l['data']);
             if ($l['data']['type'] != 'VIP') {
                 if (isset($l['data']['status'])) {
                     if ($l['data']['status'] == '00') {
                         $list_log[$k]['status'] = 1;
                     } else {
                         $list_log[$k]['status'] = 0;
                     }
                 } else {
                     $list_log[$k]['status'] = 0;
                 }
                 if (!empty($l['data']['status'])) {
                     $list_log[$k]['fail'] = 0;
                 } else {
                     $list_log[$k]['fail'] = 1;
                 }
             } else {
                 $list_log[$k]['status'] = 1;
                 $list_log[$k]['fail'] = 0;
             }
             $list_log[$k]['data'] = $l['data'];
         }
     }
     $display->add('paging', $paging);
     $display->add('list_log', $list_log);
     $display->add('is_admin', User::is_admin());
     $display->add('is_root', User::is_root());
     $display->output('ListCoin');
     //        $this->endForm();
 }
开发者ID:hqd276,项目名称:bigs,代码行数:75,代码来源:ListCoin.php

示例3: draw

 function draw()
 {
     global $display;
     //        $this->beginForm(false, 'post', false, Url::build_current(array('cmd' => 'list_log')));
     $filter_id = intval(trim(Url::get('filter_id')));
     $filter_type = intval(trim(Url::get('filter_type')));
     $type_id = intval(trim(Url::get('type_id')));
     $cid = intval(trim(Url::get('cid')));
     $display->add('cid', $cid);
     $display->add('type_id', $type_id);
     $display->add('from_time', Url::get('from_time'));
     $display->add('to_time', Url::get('to_time'));
     $cond = array();
     if (!empty($filter_id)) {
         $cond[] = 'a.id LIKE "' . $filter_id . '"';
         $display->add('filter_id', $filter_id);
     }
     if (!empty($filter_type)) {
         switch ($filter_type) {
             case 1:
                 $cond[] = ' type_id = ' . $filter_type;
                 break;
             case 2:
                 $cond[] = ' type_id = ' . $filter_type;
                 break;
             case 0:
                 $cond[] = ' type_id = ' . $filter_type;
                 break;
             default:
                 //                    $cond[] = ' type_id = 0';
                 break;
         }
         $display->add('filter_type', $filter_type);
     } else {
         $cond[] = ' type_id = 0';
         $display->add('filter_type', 0);
     }
     if (!empty($type_id) && $type_id != 0) {
         $cond[] = 'object_id = ' . $type_id;
         if (!empty($cid)) {
             $cond[] = ' (CONCAT(",", class_id, ",") LIKE "%,' . $cid . ',%") ';
         }
     }
     $from_time = 0;
     $to_time = 0;
     if (Url::get('from_time')) {
         $date_arr = explode('/', Url::get('from_time'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $from_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 0);
         }
     }
     if (Url::get('to_time')) {
         $date_arr = explode('/', Url::get('to_time'));
         if (isset($date_arr[0]) && isset($date_arr[1]) && isset($date_arr[2])) {
             $to_time = EClassApi::render_time($date_arr[1] . '/' . $date_arr[0] . '/' . (int) $date_arr[2], 1);
         }
     }
     if ($from_time) {
         $cond[] = ' `time` >= ' . $from_time;
     }
     if ($to_time) {
         $cond[] = ' `time` <= ' . $to_time;
     }
     $item_per_page = 50;
     $cond = EClassApi::analyze_conditions($cond);
     $list_log = array();
     $paging = '';
     $total_row = Logs::count_all($cond);
     if ($total_row) {
         require_once ROOT_PATH . 'core/ECPagging.php';
         $limit = '';
         $paging = ECPagging::pagingSE($limit, $total_row, $item_per_page, 10, 'page_no', true);
         $list_log = Logs::get_collection($limit, $cond, ' ORDER BY id DESC');
     }
     $list_class = Classes::get_collection_with_join(null);
     $list_lesson = Lessons::get_collection_with_join(null);
     $list_exam = Exam::get_collection(null);
     $error_message = $this->getErrorMessage('admin/log/error');
     $display->add('error_message', $error_message);
     $display->add('paging', $paging);
     $display->add('list_log', $list_log);
     $display->add('list_class', $list_class);
     $display->add('list_lesson', $list_lesson);
     $display->add('list_exam', $list_exam);
     $display->add('is_admin', User::is_admin());
     $display->output('ListLog');
     //        $this->endForm();
 }
开发者ID:hqd276,项目名称:bigs,代码行数:88,代码来源:ListLog.php


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