當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Orders::paging方法代碼示例

本文整理匯總了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');
     }
 }
開發者ID:isonz,項目名稱:fxptpcn,代碼行數:31,代碼來源:home.php


注:本文中的Orders::paging方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。