本文整理汇总了PHP中page_and_size函数的典型用法代码示例。如果您正苦于以下问题:PHP page_and_size函数的具体用法?PHP page_and_size怎么用?PHP page_and_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了page_and_size函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exam_prj_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function exam_prj_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['name'] = empty($_REQUEST['search_name']) ? '' : trim($_REQUEST['search_name']);
//名称
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['name'] = json_str_iconv($filter['name']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'prj_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['name']) {
$ex_where .= " AND name like '" . mysql_like_quote($filter['name']) . "%'";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("exam_prj") . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS['ecs']->table("exam_prj") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例2: agency_pay_log_list
function agency_pay_log_list()
{
$filter['order_sn'] = empty($_REQUEST['order_sn']) ? '' : trim($_REQUEST['order_sn']);
$filter['status'] = empty($_REQUEST['status']) ? '' : trim($_REQUEST['status']);
$filter['admin_agency_id'] = empty($_REQUEST['admin_agency_id']) ? '' : trim($_REQUEST['admin_agency_id']);
$filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'id' : trim($_REQUEST['sort_by']);
$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
$where = '';
$where .= agency_where();
$where = preg_replace('|admin_agency_id|', 'ag.agency_id', $where);
//dump($where);
/* 订单号 */
if (!empty($filter['order_sn'])) {
$where .= " AND oi.order_sn = {$filter['order_sn']}";
}
/*状态*/
if (!empty($filter['status'])) {
$where .= " AND ag.status = {$filter['status']}";
}
/*代理商*/
if (!empty($filter['admin_agency_id'])) {
$where .= " AND ag.agency_id = {$filter['admin_agency_id']}";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('agency_pay_log') . "as ag left join " . $GLOBALS['ecs']->table('users') . " as u on u.user_id = ag.user_id left join " . $GLOBALS['ecs']->table('admin_user') . " as au on au.agency_user_id = ag.agency_id left join " . $GLOBALS['ecs']->table('order_info') . " as oi on oi.order_id = ag.order_id WHERE 1 {$where} order by {$filter['sort_by']} {$filter['sort_order']} ";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
$sql = "SELECT ag.id,oi.order_sn,ag.order_id,au.user_name as admin_name,u.user_name,ag.order_amount,ag.time,ag.status FROM " . $GLOBALS['ecs']->table('agency_pay_log') . "as ag left join " . $GLOBALS['ecs']->table('users') . " as u on u.user_id = ag.user_id left join " . $GLOBALS['ecs']->table('admin_user') . " as au on au.agency_user_id = ag.agency_id left join " . $GLOBALS['ecs']->table('order_info') . " as oi on oi.order_id = ag.order_id WHERE 1 {$where} order by {$filter['sort_by']} {$filter['sort_order']} LIMIT " . $filter['start'] . ", " . $filter['page_size'] . "";
$filter['keywords'] = stripslashes($filter['keywords']);
set_filter($filter, $sql);
$res = $GLOBALS['db']->getAll($sql);
//dump($res);
$arr = array('res' => $res, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}
示例3: get_search_log
function get_search_log()
{
$where = '';
if (isset($_REQUEST['start_dateYear']) && isset($_REQUEST['end_dateYear'])) {
$start_date = $_POST['start_dateYear'] . '-' . $_POST['start_dateMonth'] . '-' . $_POST['start_dateDay'];
$end_date = $_POST['end_dateYear'] . '-' . $_POST['end_dateMonth'] . '-' . $_POST['end_dateDay'];
$where .= " AND date <= '{$end_date}' AND date >= '{$start_date}'";
$filter['start_dateYear'] = $_REQUEST['start_dateYear'];
$filter['start_dateMonth'] = $_REQUEST['start_dateMonth'];
$filter['start_dateDay'] = $_REQUEST['start_dateDay'];
$filter['end_dateYear'] = $_REQUEST['end_dateYear'];
$filter['end_dateMonth'] = $_REQUEST['end_dateMonth'];
$filter['end_dateDay'] = $_REQUEST['end_dateDay'];
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('keywords') . " WHERE searchengine='ecshop' {$where}";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$logdb = array();
$filter = page_and_size($filter);
$sql = "SELECT * FROM " . $GLOBALS['ecs']->table('keywords') . " WHERE searchengine='ecshop' {$where}" . " ORDER BY date DESC, count DESC" . " LIMIT {$filter['start']},{$filter['page_size']}";
$query = $GLOBALS['db']->query($sql);
while ($rt = $GLOBALS['db']->fetch_array($query)) {
$logdb[] = $rt;
}
$arr = array('logdb' => $logdb, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}
示例4: get_temp_list
function get_temp_list()
{
// Obtaion to the temp list
$result = get_filter();
if ($result === false) {
$filter = array();
$where = "WHERE 1";
$filter['bdate'] = empty($_REQUEST['bdate']) ? date('Y-m-d') : trim($_REQUEST['bdate']);
if (!empty($_REQUEST['city'])) {
$where .= " AND ";
} else {
$where .= " AND a.country" . db_create_in(array_keys($_SESSION['city_arr']));
}
$where .= " AND a.order_status=1 AND b.goods_price>100";
if ($filter['bdate']) {
$where .= " AND a.best_time BETWEEN '" . $filter['bdate'] . " 00:00:00' AND '" . $filter['bdate'] . " 23:59:59'";
}
$query = "SELECT DISTINCT COUNT(*) FROM ecs_order_info AS a \r\n\t\t\tLEFT JOIN ecs_order_goods AS b ON a.order_id=b.order_id \r\n\t\t\tLEFT JOIN order_dispatch AS c ON c.order_id=a.order_id \r\n\t\t\tLEFT JOIN ship_route AS d ON d.route_id=c.route_id {$where}";
$filter['record_count'] = $GLOBALS['db_read']->getOne($query);
$filter = page_and_size($filter);
$limit = "LIMIT " . $filter['start'] . "," . $filter['page_size'] . "";
$sql = "SELECT SUM(b.goods_number) AS gnum,c.turn,d.station_id \r\n\t\t\tFROM ecs_order_info AS a \r\n\t\t\tLEFT JOIN ecs_order_goods AS b ON a.order_id=b.order_id \r\n\t\t\tLEFT JOIN order_dispatch AS c ON c.order_id=a.order_id \r\n\t\t\tLEFT JOIN ship_route AS d ON d.route_id=c.route_id {$where} \r\n\t\t\tGROUP BY c.turn,d.station_id {$limit}";
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db_read']->getAll($sql);
return array('list' => $list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
示例5: sms_list
/**
* 返回短信列表数据
*/
function sms_list($class_code, $phone)
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keywords'] = empty($_REQUEST['search_keyword']) ? '' : trim($_REQUEST['search_keyword']);
//关键字
$filter['phones'] = empty($_REQUEST['search_phones']) ? '' : trim($_REQUEST['search_phones']);
//学校code
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keywords'] = json_str_iconv($filter['keywords']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'sms_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '20' : trim($_REQUEST['rows']);
$ex_where = " WHERE class_code='" . $class_code . "' and phones like '%{$phone}%'";
if ($filter['keywords']) {
$ex_where .= " AND content LIKE '%" . mysql_like_quote($filter['keywords']) . "%'";
}
$filter['record_count'] = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS["ecs"]->table("sms") . $ex_where);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS["ecs"]->table("sms") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
$filter['keywords'] = stripslashes($filter['keywords']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$sms_list = $GLOBALS['db']->getAll($sql);
$arr = array('rows' => $sms_list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例6: get_stat_list
function get_stat_list()
{
// Obtaion to the statistics list
$result = get_filter();
if ($result === false) {
$filter = array();
$city_group = $_SESSION['city_group'];
$where = "WHERE 1 ";
$bdate = date('Y-m-d', strtotime(date('Y-m-d')) - 3600 * 24 * 2);
$sdate = date('Y-m-d', strtotime(date('Y-m-d')) - 3600 * 24 * 1);
$filter['turn'] = empty($_REQUEST['turn']) ? '' : intval($_REQUEST['turn']);
$filter['bdate'] = empty($_REQUEST['bdate']) ? $bdate : trim($_REQUEST['bdate']);
$filter['sdate'] = empty($_REQUEST['sdate']) ? $sdate : trim($_REQUEST['sdate']);
$filter['order_sn'] = empty($_REQUEST['order_sn']) ? '' : trim($_REQUEST['order_sn']);
$filter['print_sn'] = empty($_REQUEST['print_sn']) ? '' : trim($_REQUEST['print_sn']);
$filter['stan'] = empty($_REQUEST['city']) ? $_SESSION['city_arr'] : intval($_REQUEST['city']);
$join = "";
if (!empty($filter['turn'])) {
$join .= " LEFT JOIN order_dispatch AS d ON d.order_id=b.order_id";
}
if (!empty($filter['print_sn'])) {
$join .= " LEFT JOIN print_log_x AS p ON p.order_id=b.order_id";
}
$term = "WHERE 1 AND b.order_status='1' AND c.goods_price>40";
if ($filter['bdate'] && $filter['sdate']) {
$term .= " and b.best_time>='" . $filter['bdate'] . " 00:00:00' AND b.best_time<='" . $filter['sdate'] . " 23:59:59'";
}
if ($filter['turn']) {
$term .= " AND d.turn='" . $filter['turn'] . "'";
}
if ($filter['print_sn']) {
$term .= " and p.print_sn='" . $filter['print_sn'] . "'and p.city_group=" . $city_group;
}
if ($filter['order_sn']) {
$term .= " and b.order_sn like '%" . $filter['order_sn'] . "'";
}
$query = "select count(*) from \r\n\t\t\t(SELECT b.best_time,c.goods_id,c.goods_attr,SUM(c.goods_number) AS gnum,GROUP_CONCAT(c.order_id) AS order_group \r\n\t\t\tFROM order_genid AS a \r\n\t\t\tLEFT JOIN ecs_order_info AS b ON b.order_id=a.order_id \r\n\t\t\tLEFT JOIN ecs_order_goods AS c ON c.order_id=b.order_id " . $join . " {$term} \r\n\t\t\tGROUP BY c.goods_id,c.goods_attr )as a ";
$filter['record_count'] = $GLOBALS['db_read']->getOne($query);
$filter = page_and_size($filter);
$limit = "LIMIT " . $filter['start'] . "," . $filter['page_size'];
$sql = "SELECT b.best_time,c.goods_id,c.goods_attr,SUM(c.goods_number) AS gnum,GROUP_CONCAT(c.order_id) AS order_group \r\n\t\t\tFROM order_genid AS a \r\n\t\t\tLEFT JOIN ecs_order_info AS b ON b.order_id=a.order_id \r\n\t\t\tLEFT JOIN ecs_order_goods AS c ON c.order_id=b.order_id " . $join . " {$term} \r\n\t\t\tGROUP BY c.goods_id,c.goods_attr ASC " . $limit;
//print_r($sql);exit;
$goods = $GLOBALS['db_read']->getAll($sql);
foreach ($goods as $key => $val) {
$list['stat'][$key]['goods_id'] = $val['goods_id'];
$list['stat'][$key]['goods_name'] = get_goods_name($val['goods_id']);
$list['stat'][$key]['bdate'] = $filter['bdate'];
$list['stat'][$key]['goods_attr'] = empty($val['goods_attr']) ? '0.25' : floatval($val['goods_attr']);
$list['stat'][$key]['goods_sum'] = $val['gnum'];
$list['stat'][$key]['order_group'] = $val['order_group'];
$list['weight_total'] += $val['gnum'] * floatval($val['goods_attr']);
$list['num_total'] += $val['gnum'];
set_filter($filter, $sql);
}
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
return array('list' => $list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count'], 'sql' => $sql);
}
示例7: goods_stock
function goods_stock()
{
global $ecs, $db;
$result = get_filter($param_str);
if ($result === false) {
$filter['goods_name'] = empty($_REQUEST['goods_name']) ? '' : trim($_REQUEST['goods_name']);
$filter['goods_sn'] = empty($_REQUEST['goods_sn']) ? '' : trim($_REQUEST['goods_sn']);
$where = ' WHERE supplier_id=' . $_SESSION['supplier_id'];
if (!empty($filter['goods_name'])) {
$where .= ' AND goods_name LIKE "%' . $filter['goods_name'] . '%" ';
}
if (!empty($filter['goods_sn'])) {
$where .= ' AND goods_sn LIKE "%' . $filter['goods_sn'] . '%" ';
}
$sql = 'SELECT COUNT(*) FROM ' . $ecs->table('goods') . $where;
$filter['record_count'] = $db->getOne($sql);
$filter['page'] = empty($_REQUEST['page']) || intval($_REQUEST['page']) <= 0 ? 1 : intval($_REQUEST['page']);
if (isset($_REQUEST['page_size']) && intval($_REQUEST['page_size']) > 0) {
$filter['page_size'] = intval($_REQUEST['page_size']);
} elseif (isset($_COOKIE['ECSCP']['page_size']) && intval($_COOKIE['ECSCP']['page_size']) > 0) {
$filter['page_size'] = intval($_COOKIE['ECSCP']['page_size']);
} else {
$filter['page_size'] = 15;
}
$filter = page_and_size($filter);
$limit = ' LIMIT ' . $filter['start'] . ',' . $filter['page_size'];
$sql = 'SELECT goods_id,goods_sn,goods_name,goods_number FROM ' . $ecs->table('goods') . $where . $limit;
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$goods = $db->getAll($sql);
foreach ($goods as $goods_key => $goods_val) {
$sql = 'SELECT goods_attr AS goods_attr_id,product_number FROM ' . $ecs->table('products') . ' WHERE goods_id=' . $goods_val['goods_id'];
$attr = $db->getAll($sql);
foreach ($attr as $attr_key => $attr_val) {
$goods_attr_arr = explode('|', $attr_val['goods_attr_id']);
$attr_sql = implode(' OR goods_attr_id= ', $goods_attr_arr);
$sql = 'SELECT attr_value FROM ' . $ecs->table('goods_attr') . ' WHERE goods_attr_id=' . $attr_sql;
$attr_name_arr = $db->getAll($sql);
$attr_name = '';
foreach ($attr_name_arr as $name_key => $name_val) {
$attr_name .= implode(' ', $name_val);
}
$attr_val['goods_attr_name'] = $attr_name;
$attr[$attr_key] = $attr_val;
}
$goods_val['goods_attr'] = $attr;
$goods[$goods_key] = $goods_val;
}
$arr = array('goods' => $goods, 'filter' => $filter);
return $arr;
}
示例8: resource_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function resource_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['resource_type'] = empty($_REQUEST['search_resource_type']) ? '' : trim($_REQUEST['search_resource_type']);
//编号
$filter['name'] = empty($_REQUEST['search_name']) ? '' : trim($_REQUEST['search_name']);
//名称
$filter['sdate'] = empty($_REQUEST['search_sdate']) ? '' : trim($_REQUEST['search_sdate']);
//起始日期
$filter['edate'] = empty($_REQUEST['search_edate']) ? '' : trim($_REQUEST['search_edate']);
//截止日期
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['name'] = json_str_iconv($filter['name']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'resource_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE d.class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['resource_type']) {
$ex_where .= " AND d.type = '" . mysql_like_quote($filter['resource_type']) . "'";
}
if ($filter['name']) {
$ex_where .= " AND d.name like '" . mysql_like_quote($filter['name']) . "%'";
}
if ($filter['sdate']) {
$ex_where .= " AND d.created >='" . mysql_like_quote($filter['sdate']) . "'";
}
if ($filter['edate']) {
$ex_where .= " AND d.created <='" . mysql_like_quote($filter['edate']) . "'";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("resource") . " d " . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT d.*, s.name as resource_type " . " FROM " . $GLOBALS['ecs']->table("resource") . " d left join " . $GLOBALS['ecs']->table("resource_type") . " s on d.type=s.rtype_id " . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
foreach ($list as $k => $v) {
$list[$k]['creator_name'] = get_user_name($v["creator"], 'admin');
}
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例9: get_distrib_sort
function get_distrib_sort()
{
$filter = array();
$sql = "SELECT COUNT(distinct user_id) FROM " . $GLOBALS['ecs']->table('distrib_sort');
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
$arr = array();
$sql = "SELECT d.*,sum(money) as total_money,u.user_name FROM " . $GLOBALS['ecs']->table('distrib_sort') . " as d inner join " . $GLOBALS['ecs']->table('users') . " as u on d.user_id = u.user_id group by d.user_id order by total_money desc";
$res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
while ($rows = $GLOBALS['db']->fetchRow($res)) {
$arr[] = $rows;
}
return array('arr' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
示例10: get_order_list
function get_order_list()
{
//查询条件
$filter['date'] = $_REQUEST['date'];
$where = " AND best_time LIKE '" . $filter['date'] . "%'";
$sql = "SELECT count(*) FROM `ecs_order_goods` AS a LEFT JOIN ecs_order_info AS b ON a.order_id = b.order_id WHERE b.order_status =1 \r\n\t\t\t\tAND a.goods_price >=45 " . $where . "ORDER BY surplus desc,bonus desc,pay_note desc";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql1 = "SELECT b.order_sn, a.goods_name,a.goods_attr, a.goods_number,b.surplus,b.bonus,b.goods_amount,b.money_paid,b.order_amount, b.pay_name, \r\n\t\t\t\tb.pay_note,best_time FROM `ecs_order_goods` AS a LEFT JOIN ecs_order_info AS b ON a.order_id = b.order_id WHERE b.order_status =1 \r\n\t\t\t\tAND a.goods_price >=45 " . $where . " ORDER BY surplus desc,bonus desc,pay_note desc LIMIT " . $filter[start] . "," . $filter[page_size];
$row = $GLOBALS['db']->getAll($sql1);
$arr = array('item' => $row, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}
示例11: get_affiliate_ck
function get_affiliate_ck($user_id)
{
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('order_info') . " o" . " LEFT JOIN" . $GLOBALS['ecs']->table('users') . " u ON o.user_id = u.user_id" . " LEFT JOIN " . $GLOBALS['ecs']->table('affiliate_log') . " a ON o.order_id = a.order_id" . " WHERE o.user_id > 0 AND a.user_id = '{$user_id}' AND o.is_separate > 0 AND a.separate_type = 0";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$logdb = array();
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT o.*, a.log_id,a.user_id as suid, a.user_name as auser, a.money, a.point, a.separate_type,u.parent_id as up FROM " . $GLOBALS['ecs']->table('order_info') . " o" . " LEFT JOIN" . $GLOBALS['ecs']->table('users') . " u ON o.user_id = u.user_id" . " LEFT JOIN " . $GLOBALS['ecs']->table('affiliate_log') . " a ON o.order_id = a.order_id" . " WHERE o.user_id > 0 AND a.user_id = '{$user_id}' AND o.is_separate > 0 AND a.separate_type = 0" . " ORDER BY order_id DESC";
$res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
while ($rows = $GLOBALS['db']->fetchRow($res)) {
$rows['total_split_money'] = get_split_money_by_orderid($rows['order_id']);
$rows['set_money'] = $rows['money'];
$logdb[] = $rows;
}
$arr = array('logdb' => $logdb, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}
示例12: request_log
function request_log()
{
$filter = array();
/* 获得总记录数据 */
$sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('connector_app');
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
$filter = page_and_size($filter);
/* 获得广告数据 */
$arr = array();
$sql = 'SELECT v.id,v.imei,v.phone,v.sim_sn,v.imsi,v.os,v.system_version,v.app_version,v.user_info,v.time,' . 'v.insert_time,u.user_name FROM ' . $GLOBALS['ecs']->table('connector_app') . ' as v left join ' . $GLOBALS['ecs']->table('users') . ' as u on v.user_id = u.user_id ORDER BY v.id DESC';
$res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
while ($rows = $GLOBALS['db']->fetchRow($res)) {
$rows['time'] = date('Y-m-d', $rows['time']);
$arr[] = $rows;
}
return array('request_log_list' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
示例13: msg_list1
/**
*
*
* @access public
* @param
*
* @return void
*/
function msg_list1()
{
$sql = "SELECT count(*) FROM " . $GLOBALS['ecs']->table('fankui');
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT msg_id, msg_content,msg_time, COUNT(msg_id) AS reply " . "FROM " . $GLOBALS['ecs']->table('fankui') . "GROUP BY msg_id " . "ORDER by msg_id DESC " . "LIMIT " . $filter['start'] . ', ' . $filter['page_size'];
$msg_list = $GLOBALS['db']->getAll($sql);
foreach ($msg_list as $key => $value) {
if ($value['order_id'] > 0) {
$msg_list[$key]['order_sn'] = $GLOBALS['db']->getOne("SELECT order_sn FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE order_id= " . $value['order_id']);
}
$msg_list[$key]['msg_time'] = local_date($GLOBALS['_CFG']['time_format'], $value['msg_time']);
}
$filter['keywords'] = stripslashes($filter['keywords']);
$arr = array('msg_list' => $msg_list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}
示例14: person_list
/**
* 返回班级管理员列表数据
*
* @access public
* @param
*
* @return void
*/
function person_list()
{
$result = get_filter();
if ($result === false) {
/* 过滤条件 */
$filter['keywords'] = empty($_REQUEST['keywords']) ? '' : trim($_REQUEST['keywords']);
//名称
$filter['tel'] = empty($_REQUEST['tel']) ? '' : trim($_REQUEST['tel']);
//电话
if (isset($_REQUEST['is_ajax']) && $_REQUEST['is_ajax'] == 1) {
$filter['keywords'] = json_str_iconv($filter['keywords']);
}
$filter['sort'] = empty($_REQUEST['sort']) ? 'person_id' : trim($_REQUEST['sort']);
$filter['order'] = empty($_REQUEST['order']) ? 'DESC' : trim($_REQUEST['order']);
$filter['page'] = empty($_REQUEST['page']) ? '1' : trim($_REQUEST['page']);
$filter['page_size'] = empty($_REQUEST['rows']) ? '25' : trim($_REQUEST['rows']);
$ex_where = " WHERE class_code='" . $_SESSION["class_code"] . "' ";
if ($filter['keywords']) {
$ex_where .= " AND name LIKE '%" . mysql_like_quote($filter['keywords']) . "%'";
}
if ($filter['tel']) {
$ex_where .= " AND tel = '" . mysql_like_quote($filter['tel']) . "'";
}
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table("person") . $ex_where;
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
$sql = "SELECT * " . " FROM " . $GLOBALS['ecs']->table("person") . $ex_where . " ORDER by " . $filter['sort'] . ' ' . $filter['order'] . " LIMIT " . $filter['start'] . ',' . $filter['page_size'];
// echo $sql; echo '<br>';
$filter['keywords'] = stripslashes($filter['keywords']);
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$list = $GLOBALS['db']->getAll($sql);
// foreach ($list AS $key=>$val)
// {
// $list[$key]['created'] = local_date($GLOBALS['_CFG']['time_format'], $val['created']);
// }
$arr = array('rows' => $list, 'filter' => $filter, 'page' => $filter['page_count'], 'total' => $filter['record_count']);
return $arr;
}
示例15: get_email_list
function get_email_list()
{
$result = get_filter();
if ($result === false) {
$filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'stat' : trim($_REQUEST['sort_by']);
$filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'ASC' : trim($_REQUEST['sort_order']);
$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('email_list');
$filter['record_count'] = $GLOBALS['db']->getOne($sql);
/* 分页大小 */
$filter = page_and_size($filter);
/* 查询 */
$sql = "SELECT * FROM " . $GLOBALS['ecs']->table('email_list') . " ORDER BY " . $filter['sort_by'] . ' ' . $filter['sort_order'] . " LIMIT " . $filter['start'] . ",{$filter['page_size']}";
set_filter($filter, $sql);
} else {
$sql = $result['sql'];
$filter = $result['filter'];
}
$emaildb = $GLOBALS['db']->getAll($sql);
$arr = array('emaildb' => $emaildb, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
return $arr;
}