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


PHP product::get方法代码示例

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


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

示例1: count

    if (!is_object($d)) {
        echo "Return should be an object\n";
        exit;
    }
}
$dept = product::join('user')->byId(5);
if (count($dept->data) != 13) {
    echo "wrong props count " . count($dept->data) . "\n";
    exit;
}
if ($db->count != 1) {
    echo "wrong count after byId\n";
    exit;
}
// hasOne
$products = product::get();
$cnt = 0;
foreach ($products as $p) {
    if (get_class($d) != 'product') {
        echo "wrong class returned\n";
        exit;
    }
    if (!$p->userId instanceof user) {
        echo "wrong return class of hasOne result\n";
        exit;
    }
    $cnt++;
}
if ($cnt != $db->count && $cnt != 5) {
    echo "wrong count after get\n";
    exit;
开发者ID:TwistItLabs,项目名称:website,代码行数:31,代码来源:dbObjectTests.php

示例2: checkLogin

<?php
//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();

$SI_SYSTEM_DEFAULTS = new SimpleInvoices_Db_Table_SystemDefaults();
$SI_TAX = new SimpleInvoices_Db_Table_Tax();

#get the invoice id
$expense_id = $_GET['id'];

$expense = expense::get($expense_id);
$detail = expense::detail();
$detail['customer'] = customer::get($expense['customer_id']);
$detail['biller'] = biller::select($expense['biller_id']);
$detail['invoice'] = invoice::select($expense['invoice_id']);
$detail['product'] = product::get($expense['product_id']);
$detail['expense_account'] = expenseaccount::select($expense['expense_account_id']);
$detail['expense_tax'] = expensetax::get_all($expense_id);
$detail['expense_tax_total'] = $expense['amount'] + expensetax::get_sum($expense_id);
$detail['expense_tax_grouped'] = expensetax::grouped($expense_id);
$detail['status_wording'] = $expense['status']==1?$LANG['paid']:$LANG['not_paid'];

$taxes = $SI_TAX->fetchAllActive();
#$tax_selected = getTaxRate($product['default_tax_id']);
$defaults = $SI_SYSTEM_DEFAULTS->fetchAll();

$smarty -> assign('expense',$expense);
$smarty -> assign('detail',$detail);
$smarty -> assign('taxes',$taxes);
$smarty -> assign('defaults',$defaults);
$smarty -> assign('tax_selected',$tax_selected);
开发者ID:CalhounGaming,项目名称:simpleinvoices,代码行数:31,代码来源:details.php

示例3: expense

checkLogin();
#get the invoice id
$expense_id = $_GET['id'];
$expenseobj = new expense();
$customerobj = new customer();
$billerobj = new biller();
$invoiceobj = new invoice();
$productobj = new product();
$expenseaccountobj = new expenseaccount();
$expensetaxobj = new expensetax();
$expense = $expenseobj->get($expense_id);
$detail = $expenseobj->detail();
$detail['customer'] = $customerobj->get($expense['customer_id']);
$detail['biller'] = $billerobj->select($expense['biller_id']);
$detail['invoice'] = $invoiceobj->select($expense['invoice_id']);
$detail['product'] = $productobj->get($expense['product_id']);
$detail['expense_account'] = $expenseaccountobj->select($expense['expense_account_id']);
$detail['expense_tax'] = $expensetaxobj->get_all($expense_id);
$detail['expense_tax_total'] = $expense['amount'] + $expensetaxobj->get_sum($expense_id);
$detail['expense_tax_grouped'] = $expensetaxobj->grouped($expense_id);
$detail['status_wording'] = $expense['status'] == 1 ? $LANG['paid'] : $LANG['not_paid'];
$taxes = getActiveTaxes();
#$tax_selected = getTaxRate($product['default_tax_id']);
$defaults = getSystemDefaults();
$smarty->assign('expense', $expense);
$smarty->assign('detail', $detail);
$smarty->assign('taxes', $taxes);
$smarty->assign('defaults', $defaults);
//$smarty -> assign('tax_selected',$tax_selected);
//$smarty -> assign('customFieldLabel',$customFieldLabel);
$smarty->assign('pageActive', 'expense');
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:31,代码来源:details.php

示例4: deleteAccessories

 function deleteAccessories($productId)
 {
     $sentData = $this->input->post('sendData');
     $sentData = trim($sentData, '-');
     $sentData = explode("-", $sentData);
     array_push($sentData, "0");
     $acc = new product();
     $acc->where_in('id', $sentData);
     $acc->get();
     $product = new Product($productId);
     $product->delete($acc->all, 'accessory');
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:12,代码来源:products.php

示例5: showCart

 function showCart()
 {
     $step = 1;
     if ($this->uri->segment(2, "") != "") {
         $stepStr = $this->uri->segment(2, "");
         $stepStr = explode("-", $stepStr);
         $step = $stepStr[1];
         if ($step != '2' && $step != '3') {
             show_404();
         }
         if (!$this->_checkLogin()) {
             redirect('dang-nhap/' . 'gio-hang/buoc-' . $step);
         }
     }
     //get product from cookie
     $cartDetail = $this->getCartCookie();
     $product = new product();
     $productList = array(0);
     $store = new store();
     $store->get_iterated();
     $dis['store'] = $store;
     foreach ($cartDetail as $key => $value) {
         array_push($productList, $key);
     }
     $product->where_in('id', $productList);
     $product->get();
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $cart = new Cartitem();
         $cart->customer_id = $this->customer->id;
         $cart->shipType = $this->input->post('receiveType');
         $cart->paymentType = $this->input->post('payment');
         $cart->deliverStore_id = $this->input->post('branchReceive');
         $cart->paymentStore_id = $this->input->post('branchPayment');
         $cart->shipName = $this->input->post('info_name');
         $cart->shipEmail = $this->input->post('info_email');
         $cart->shipPhone = $this->input->post('info_phone');
         $cart->shipDescription = $this->input->post('info_description');
         $cart->shipAddress = $this->input->post('info_address');
         $cart->status = enum::CART_WAIT_FOR_PROCESS;
         $cart->save();
         $sum = 0;
         foreach ($product as $row) {
             $cartDetailItem = new Cartdetail();
             $cartDetailItem->cartitem_id = $cart->id;
             $cartDetailItem->product_id = $row->id;
             $cartDetailItem->quantity = $cartDetail[$row->id];
             $cartDetailItem->price = $row->getRealPriceNum();
             $cartDetailItem->productName = $row->name;
             $cartDetailItem->inBox = $row->inBox;
             $cartDetailItem->status = enum::CARTDETAIL_AVAILABLE;
             $cartDetailItem->save();
             $cartDetailItem->clear();
             $itemTotal = $cartDetail[$row->id] * $row->getRealPriceNum();
             $sum += $itemTotal;
         }
         $cart->total = $sum;
         $cart->save();
         $this->sendMailCustomer($cart->id);
         $this->sendMailCustomerService($cart->id);
         //save cart detail
         setcookie("userCart", json_encode(array()), mktime() . time() + 60 * 60 * 24 * 7, "/");
         $dis['view'] = 'cart/cart4';
     } else {
         $dis['step'] = $step;
         $dis['product'] = $product;
         $dis['cartDetail'] = $cartDetail;
         $dis['view'] = 'cart/cart1';
     }
     $dis['base_url'] = base_url();
     $this->viewfront($dis);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:71,代码来源:cart.php


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