本文整理汇总了PHP中Orders::paging方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::paging方法的具体用法?PHP Orders::paging怎么用?PHP Orders::paging使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orders
的用法示例。
在下文中一共展示了Orders::paging方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: strtotime
$where = $where0 . "user_code='{$user_code}'";
} else {
$where = $where0 . "user_code='{$user_code}' AND order_status={$status}";
}
if ($stardate && $enddate) {
$stardate = (int) strtotime($stardate);
$enddate = (int) strtotime($enddate);
$enddate = date('Y-m-d 23:59:59', $enddate);
$enddate = (int) strtotime($enddate);
if ($enddate > 0 && $stardate > 0 && $enddate >= $stardate) {
$where = $where0 . "user_code='{$user_code}' AND create_time>={$stardate} AND create_time<={$enddate}";
}
}
if (!$keyword) {
//DB::Debug();
$order = Orders::paging($page, $page_size, $where, "id DESC", "*");
} else {
if ('bh' == $keyword) {
//DB::Debug();
$ordertable = Orders::table();
$orderproducttable = OrdersProducts::table();
$sql = " SELECT a.* FROM {$ordertable} AS a, {$orderproducttable} AS b WHERE RIGHT(a.order_code,2)='BH' AND a.order_code=b.order_code AND a.user_code='{$user_code}' ORDER BY a.id DESC";
$order = Paging::bySQL($sql, $page, $page_size, 'a');
} else {
//DB::Debug();
$ordertable = Orders::table();
$orderproducttable = OrdersProducts::table();
$sql = " SELECT a.* FROM {$ordertable} AS a, {$orderproducttable} AS b WHERE (RIGHT(a.order_code,2)='SK' OR LEFT(a.order_code,4)='FXAD') AND a.order_code=b.order_code AND a.user_code='{$user_code}' AND (a.order_code LIKE '%{$keyword}%' OR b.product_sku LIKE '%{$keyword}%') GROUP BY a.order_code ORDER BY a.id DESC";
$order = Paging::bySQL($sql, $page, $page_size, 'a');
}
}