本文整理汇总了PHP中product::where_in方法的典型用法代码示例。如果您正苦于以下问题:PHP product::where_in方法的具体用法?PHP product::where_in怎么用?PHP product::where_in使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product
的用法示例。
在下文中一共展示了product::where_in方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
function getData()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
//load visitedProduct
//load userinfo bar
$output['visitedProduct'] = $this->getVisitedProduct();
$output['userInfo'] = $this->getUserInfo();
//load product comment and add product to visited list
$productId = $this->input->post('productId');
if ($productId != 0) {
$output['productComment'] = $this->getProductComment($productId);
$this->addProductCookie($productId);
}
//load compare product
$compareCookie = $this->input->cookie('compareProduct');
$compareArray = explode(",", $compareCookie);
array_push($compareArray, 0);
$compareProduct = new product();
$compareProduct->where_in('id', $compareArray);
$compareProduct->get_iterated();
$this->compareProduct = $compareProduct;
$this->compareArray = $compareArray;
$dis['base_url'] = base_url();
$output['compareProduct'] = $this->load->view('front/includes/compareProductSmall', $dis, true);
$output['compareArray'] = $compareArray;
//get number of cart item
$output['numCart'] = $this->countCartItem();
$this->output->set_header('Content-type: application/json');
$this->output->set_output(json_encode($output));
} else {
show_404();
}
}
示例2: 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');
}
示例3: compare
function compare()
{
$this->isCache = false;
//compare product put from cookie
$compareCookie = $this->input->cookie('compareProduct');
$compareArray = explode(",", $compareCookie);
array_push($compareArray, 0);
$compareProduct = new product();
$compareProduct->where_in('id', $compareArray);
$compareProduct->get_iterated();
$this->compareProduct = $compareProduct;
$this->compareArray = $compareArray;
$this->menu_active = 'compare';
$dis['base_url'] = base_url();
$dis['view'] = 'product/product_compare';
$this->page_title = "So sánh sản phẩm - Di động việt";
$this->page_description = "So sánh các tính năng sản phẩm";
$this->page_keyword = "So sánh tính năng sản phẩm";
$dis['breadcum'] = "So sánh sản phẩm";
$this->viewfront($dis);
}
示例4: 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);
}