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


PHP DB::LimitQuery方法代码示例

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


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

示例1: GetValidVoucher

	static function GetValidVoucher($team_id) {
		$ccon = array('team_id' => $team_id, 'order_id' => 0);
		return DB::LimitQuery('voucher', array(
					'condition' => $ccon,
					'one' => true,
					));
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:7,代码来源:ZVoucher.class.php

示例2: get

 public function get($start, $end, $type = null)
 {
     $condition = array("create_time >= {$start}", "create_time <= {$end}");
     if ($type !== null) {
         $condition['type'] = $type;
     }
     $result = DB::LimitQuery($this->table, $condition, null, $this->dbType);
     return $result;
 }
开发者ID:jesse108,项目名称:admin_base,代码行数:9,代码来源:DB.class.php

示例3: TipSuccess

 public static function TipSuccess($order)
 {
     $orders = DB::LimitQuery('order', array('condition' => array('team_id' => $order['team_id'], 'state' => 'pay')));
     foreach ($orders as $order) {
         $team = Table::Fetch('team', $order['team_id']);
         $user = Table::Fetch('user', $order['user_id']);
         mail_tipped($team, $order, $user);
     }
 }
开发者ID:jowino,项目名称:bd786110cact,代码行数:9,代码来源:ZCoupon.class.php

示例4: SetOrderState

 public static function SetOrderState($team)
 {
     if ($team->close_time == 0) {
         return;
     }
     $c = array('team_id' => $team['id'], 'state' => 'unpay');
     $os = DB::LimitQuery('order', array('condition' => $condition));
     $ids = Utility::GetColumn($os, 'id');
     foreach ($ids as $id) {
         Table::UpdateCache('order', $id, array('state' => 'expire'));
     }
 }
开发者ID:jowino,项目名称:bd786110cact,代码行数:12,代码来源:ZTeam.class.php

示例5: get_express_id

function get_express_id($val)
{
    /* 快递公司id为数字,依此判断直接返回或查询 */
    if (is_numeric($val)) {
        return $val;
    }
    $condition = array();
    $condition['name'] = $val;
    $condition['zone'] = 'express';
    //DB::Debug();
    $order = DB::LimitQuery('category', array('condition' => $condition, 'select' => 'id', 'one' => true));
    //dbx($order);	//TODO:debug
    return $order['id'];
}
开发者ID:norain2050,项目名称:zuituware,代码行数:14,代码来源:express.php

示例6: current_teamcategory

function current_teamcategory($gid = '0')
{
    global $city;
    $a = array('/team/seconds.php' => '所有');
    $categorys = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY sort_order DESC, id DESC'));
    $categorys = Utility::OptionArray($categorys, 'id', 'name');
    foreach ($categorys as $id => $name) {
        $a["/team/seconds.php?gid={$id}"] = $name;
    }
    $l = "/team/seconds.php?gid={$gid}";
    if (!$gid) {
        $l = "/team/seconds.php";
    }
    return current_link($l, $a, true);
}
开发者ID:norain2050,项目名称:zuituware,代码行数:15,代码来源:seconds.php

示例7: CheckOrder

 public static function CheckOrder($order)
 {
     $coupon_array = array('coupon', 'pickup');
     $team = Table::FetchForce('team', $order['team_id']);
     if (!in_array($team['delivery'], $coupon_array)) {
         return;
     }
     if ($team['now_number'] >= $team['min_number']) {
         //init coupon create;
         if ($team['now_number'] - $team['min_number'] < 5) {
             $orders = DB::LimitQuery('order', array('condition' => array('team_id' => $order['team_id'], 'state' => 'pay')));
             foreach ($orders as $order) {
                 self::Create($order);
             }
         } else {
             self::Create($order);
         }
     }
 }
开发者ID:BGCX262,项目名称:zuitu-svn-to-git,代码行数:19,代码来源:ZCoupon.class.php

示例8: CheckOrder

 public static function CheckOrder($order)
 {
     $coupon_array = array('express');
     $team = Table::FetchForce('team', $order['team_id']);
     if (!in_array($team['delivery'], $coupon_array) || !option_yes('expressbuysms')) {
         return;
     }
     if ($team['now_number'] >= $team['min_number']) {
         //init express sms;
         $last = $team['conduser'] == 'Y' ? 1 : $order['quantity'];
         if ($team['now_number'] - $team['min_number'] < $last) {
             $orders = DB::LimitQuery('order', array('condition' => array('team_id' => $order['team_id'], 'state' => 'pay')));
             foreach ($orders as $order) {
                 sms_express_buy($order);
             }
         } else {
             sms_express_buy($order);
         }
     }
 }
开发者ID:norain2050,项目名称:zuituware,代码行数:20,代码来源:ZExpress.class.php

示例9: CheckOrder

 public static function CheckOrder($order)
 {
     $coupon_array = array('thirdpart');
     $team = Table::FetchForce('team', $order['team_id']);
     if (!in_array($team['delivery'], $coupon_array)) {
         return;
     }
     if ($team['now_number'] >= $team['min_number']) {
         //init coupon create;
         $last = $team['conduser'] == 'Y' ? 1 : $order['quantity'];
         $offset = max(5, $last);
         if ($team['now_number'] - $team['min_number'] < $last) {
             $orders = DB::LimitQuery('order', array('condition' => array('team_id' => $order['team_id'], 'state' => 'pay')));
             foreach ($orders as $order) {
                 self::Create($order);
             }
         } else {
             self::Create($order);
         }
     }
 }
开发者ID:BGCX262,项目名称:zuituware-svn-to-git,代码行数:21,代码来源:ZThirdpart.class.php

示例10: get_city

function get_city($ip = null)
{
    global $INI;
    $hotcity_keys = array_keys($INI['hotcity']);
    $cities = DB::LimitQuery('category', array('condition' => array('zone' => 'city'), 'cache' => 2592000));
    $ip = $ip ? $ip : Utility::GetRemoteIP();
    $url = "http://open.baidu.com/ipsearch/s?wd={$ip}&tn=baiduip";
    $res = mb_convert_encoding(Utility::HttpRequest($url), 'UTF-8', 'GBK');
    $city = array();
    if (preg_match('#来自:<b>(.+)</b>#Ui', $res, $m)) {
        foreach ($cities as $one) {
            if (FALSE !== strpos($m[1], $one['name'])) {
                $city = $one;
                break;
            }
        }
    }
    if (!in_array($city['ename'], $hotcity_keys)) {
        return DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'ename' => $hotcity_keys[0]), 'one' => true));
    }
    return $city;
}
开发者ID:jowino,项目名称:bd786110cact,代码行数:22,代码来源:utility.php

示例11: date

                    $team = Table::Fetch('team', $coupon['team_id']);
                    Session::Set('notice-ok', '<div class=yzcg style= margin-bottom:8px><b>验证成功!</b></div>' . '<div  class=ts><span>优券密码:</span>' . $coupon['id'] . '</div>' . '<div class=ts><span>验证时间:</span>' . date('Y-m-d H:i:s', time()) . '</div>' . '<div class=ts><span>项目名称:</span>' . '<a target=_blank href=http://www.milituan.net/team/' . $coupon['team_id'] . '.html>' . $team['product'] . '</a>' . '</div>');
                    $status = "OK";
                }
            }
        }
    }
    $data = date('Y-m-d H:i:s') . " - " . $login_partner['username'] . " - " . $ruian . " - " . $status;
    file_put_contents(DIR_CONFIGURE . '/consume.log', $data . "\n", FILE_APPEND);
}
/**
 * Recent record / num 5
 * @author  abei <abei@qiang8.cn>
 * @version 20131026
 */
$now = time();
$list_condition['consume'] = 'Y';
$list_condition[] = "`consume_time` < " . $now . " AND `consume_time` > " . ($now - 86400);
if ($login_partner['fid'] == 0) {
    //  i am father
    $list_condition['partner_id'] = $login_partner['id'];
} else {
    //  i am stroe
    $list_condition['store_id'] = $login_partner['store_id'];
}
$count = Table::Count('coupon', $list_condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 10);
$couponList = DB::LimitQuery('coupon', array('condition' => $list_condition, 'order' => 'ORDER BY  consume_time DESC', 'size' => $pagesize, 'offset' => $offset));
$partner_ids = Utility::GetColumn($couponList, 'doer_id');
$partners = Table::Fetch('partner', $partner_ids);
include template('biz_consume');
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:index.php

示例12: list

		$join_number += $one['now_number'];
	}
	
//今日新品判断
if($ncon == 'new'){
	$condition[] = "begin_time >= '{$daytime}'";
}

if($sid) $condition['sub_id'] = $sid;
if($cid) $condition[] = "((city_ids like '%@{$cid}@%' or city_ids like '%@0@%') or city_id in(0,{$cid}))";
if ($group_id) $condition['group_id'] = $group_id;

$count = Table::Count('team', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 100);
$teams = DB::LimitQuery('team', array(
	'condition' => $condition,
	'order' => 'ORDER BY ' . $order . ' now_number DESC',
	'size' => $pagesize,
	'offset' => $offset,
));
//判断是否卖光了
foreach($teams AS $id=>$one){
	team_state($one);
	if (!$one['close_time']) $one['picclass'] = 'isopen';
	if ($one['state']=='soldout') $one['picclass'] = 'soldout';
	$teams[$id] = $one;
}

$pagetitle = '七夕情人节:鲜花专场(爱就大声告诉她)';
include template('zt_qx_xh2013_08_09');
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:zt_qx_xh2013_08_09.php

示例13: array

			'order' => 'ORDER BY id DESC',
			));
			
$partners = Utility::OptionArray($partners, 'id', 'title');
$selector = $team['id'] ? 'edit' : 'create';

/* 快递公司信息 */
$express = db::LimitQuery('category',array(
			'condition' => array( 'zone' => 'express', 'display'=>'Y'),
			));
$relate = unserialize($team['express_relate']);
/* 合并订单快递和快递表快递数据 */
foreach ($relate as $k=>$v) {
	$ids[] = $v['id'];
	$data[$v['id']] = $v['price'];
}
foreach ($express as $k=>$v) {
	if (in_array($v['id'] , $ids)) {
		$express[$k]['relate_data'] = $data[$v['id']];
		$express[$k]['checked'] = 'checked';
	}
}



$tplList = DB::LimitQuery('dptpl');

/* 反序列化城市信息 */
$city_ids = array_filter(explode('@', $team['city_ids']));
include template('manage_team_edit');
开发者ID:noikiy,项目名称:mdwp,代码行数:30,代码来源:edit.php

示例14: or

    }
    $condition[] = "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))";
    $count = Table::Count('team', $condition);
    list($pagesize, $offset, $pagestring) = pagestring($count, $size);
    $teams = DB::LimitQuery('team', array('condition' => $condition, 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $pagesize, 'offset' => $offset));
    $disable_multi = true;
    /***********************加入的代码:开始*********************************/
    $cates = DB::LimitQuery('category', array('condition' => array('zone' => 'group', 'fid' => '0', 'display' => 'Y'), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC'));
    $alls = array();
    $anow = time();
    foreach ($cates as $key => $value) {
        $alls[$key]['name'] = $value[name];
        $alls[$key]['ename'] = $value[ename];
        $alls[$key]['gid'] = $value[id];
        $alls[$key]['number'] = Table::Count('team', array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'"));
        $alls[$key]['teams'] = DB::LimitQuery('team', array('condition' => array('team_type' => 'normal', 'group_id' => $value[id], "(city_ids like '%@{$city_id}@%' or city_ids like '%@0@%') or (city_ids = '' and city_id in(0,{$city_id}))", "begin_time < '{$anow}'", "end_time > '{$anow}'"), 'order' => 'ORDER BY `sort_order` DESC, `id` DESC', 'size' => $value[show_number]));
        $alls[$key]['recom'] = DB::GetQueryResult("SELECT *,t.id AS tid,p.title AS ptitle, t.title AS ttitle, p.image AS pimage FROM `team` AS t LEFT JOIN `partner` as p ON t.partner_id=p.id WHERE t.group_id={$value['id']} AND t.team_type='normal' AND t.begin_time<'" . $anow . "' AND t.end_time>'" . $anow . "' AND t.is_recom='Y' AND p.display='Y'", false);
    }
    /***********************加入的代码:结束*********************************/
    die(require_once dirname(__FILE__) . '/multi.php');
} else {
    $team = $teams = index_get_team($city['id'], $group_id);
    if ($team && $team['id']) {
        $_GET['id'] = abs(intval($team['id']));
        die(require_once dirname(__FILE__) . '/team.php');
    } elseif ($teams) {
        $disable_multi = true;
        die(require_once dirname(__FILE__) . '/multi.php');
    }
}
include template('subscribe');
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:cityindex.php

示例15: if

			redirect($currefer);
		} else if ( $_SERVER['HTTP_REFERER'] ) {
			if (!preg_match('#'.$_SERVER['HTTP_HOST'].'#', $_SERVER['HTTP_REFERER'])) {
				redirect( 'index.php');
			}
			if (preg_match('#/city#', $_SERVER['HTTP_REFERER'])) {
				redirect( 'index.php');
			}
			redirect($_SERVER['HTTP_REFERER']);
		}
		redirect('index.php');
	}
}

$cities = DB::LimitQuery('category', array(
	'condition' => array( 'zone' => 'city') ,
));
foreach($cities as &$c){
	$daytime = time();
	$condition = array( 
			'city_id' => array(0, abs(intval($c['id']))),
			"begin_time <  {$daytime}",
			"end_time > {$daytime}",
			);
	$c['team_num'] = Table::Count('team',$condition);
}

$cities = Utility::AssColumn($cities, 'letter', 'ename');
ksort($cities);

开发者ID:noikiy,项目名称:mdwp,代码行数:29,代码来源:city.php


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