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


PHP Orders::findCount方法代碼示例

本文整理匯總了PHP中Orders::findCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP Orders::findCount方法的具體用法?PHP Orders::findCount怎麽用?PHP Orders::findCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Orders的用法示例。


在下文中一共展示了Orders::findCount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Pages

<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
require PHPB2B_ROOT . './libraries/page.class.php';
uses("order");
$page = new Pages();
$page->displaypg = 25;
$options = cache_read("typeoption");
setvar("pay_status", $options['common_option']);
setvar("order_status", $options['common_status']);
$conditions[] = "member_id=" . $the_memberid;
if (isset($_GET['action'])) {
    $action = trim($_GET['action']);
    if ($action == "cancel" && !empty($_GET['tradeno'])) {
        $pdb->Execute("DELETE FROM " . $tb_prefix . "orders WHERE trade_no='" . $_GET['tradeno'] . "' AND member_id='" . $the_memberid . "' AND pay_status='0'");
    }
}
$order = new Orders();
$amount = $order->findCount(null, $conditions);
$page->setPagenav($amount);
$result = $order->findAll("*", null, $conditions, " id desc", $page->firstcount, $page->displaypg);
setvar("ByPages", $page->pagenav);
setvar("datas", $result);
vtemplate("order");
開發者ID:reboxhost,項目名稱:phpb2b,代碼行數:31,代碼來源:order.php

示例2: explode

                }
            }
            $tpl_file = "order.goods";
            $result = $pdb->GetArray($sql);
            if (!empty($result)) {
                $total_price = 0;
                for ($i = 0; $i < count($result); $i++) {
                    $tmp_str = explode("|", $result[$i]['content']);
                    if ($result[$i]['goods_id'] == "2" && strpos($result[$i]['content'], "|") === false) {
                        $total_price = $result[$i]['total_price'];
                        $result[$i]['price'] = $result[$i]['total_price'];
                        $result[$i]['charge'] = 1;
                    } else {
                        $total_price += $result[$i]['price'] * $result[$i]['amount'];
                    }
                }
                setvar("Items", $result);
                setvar("TotalPrice", $total_price);
            }
            template($tpl_file);
            exit;
        }
    }
}
$joins[] = "LEFT JOIN {$tb_prefix}members m ON m.id=Orders.member_id LEFT JOIN {$tb_prefix}memberfields mf ON mf.member_id=Orders.member_id";
$amount = $order->findCount($joins, null, "Orders.id");
$page->setPagenav($amount);
$result = $order->findAll("Orders.*,m.username,mf.first_name,mf.last_name as true_name", $joins, $conditions, " Orders.id DESC", $page->firstcount, $page->displaypg);
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
template($tpl_file);
開發者ID:reboxhost,項目名稱:phpb2b,代碼行數:31,代碼來源:order.php


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