コード例 #1
0
ファイル: orders.php プロジェクト: dalinhuang/c2my
    case "all":
        break;
    default:
        $state = 0;
}
include INC_PATH . "/order.class.php";
$o = new OrderClass();
if ($type == "clear" && !empty($oid)) {
    editstate("order", "state", "oid={$oid}", 2);
    //修改订单状态为取消  1完成 2作废 3退款给用户
    showmessage(lang('Cancelorder_success'), $theurl, true);
}
$uname = $_USERS['uname'];
$wherestr[] = "uname='{$uname}'";
if (!empty($wherestr)) {
    $wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $o->getcount($wheresql);
//总信息数
$pagesize = 15;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$value = $o->getdata("{$offset},{$pagesize}", $wheresql, "", "ALL", "*,O.state");
//获取团购数据
include template('member_orders');
//包含输出指定模板
コード例 #2
0
ファイル: orderlist.php プロジェクト: dalinhuang/c2my
<?php

//我的劵
InitGP(array("action", "type", "oid", "sid", "page"));
//初始化变量全局返回
include_once INC_PATH . "/order.class.php";
$o = OrderClass::init();
$Table = new OrderClass();
$datanum = $Table->getcount("uname='admin'");
AjaxHead();
if (empty($action)) {
    $uname = $_USERS['uname'];
    $wherestr[] = "uname='{$uname}'";
    if ($type == 1) {
        $wherestr[] = "state=4";
    } elseif ($type == 2) {
        $wherestr[] = "state =3";
    }
    if (!empty($wherestr)) {
        $wheresql = implode(' AND ', $wherestr);
    }
    //条件汇总
    $dataarray = $o->getdata("", $wheresql, "");
    //获取团购数据
    //订单分类
    $dataarray123 = $dataarray4 = $dataarray5 = array();
    if (is_array($dataarray)) {
        foreach ($dataarray as $val) {
            //if($val['state'] > 0 && $val['state'] < 4){
            if ($val['state'] > 0 && $val['state'] <= 6 && $val['state'] != 5) {
                //已到仓库订单