本文整理汇总了PHP中Order::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::where方法的具体用法?PHP Order::where怎么用?PHP Order::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSuccess
/**
* 获取成功的订单
* @return [type] [description]
*/
public function getSuccess()
{
$data = array('main' => url('/'), 'announce' => url('/announce'), 'category' => url('/category'), 'deliver' => url('/deliver'), 'good' => url('/good'), 'map' => url('/map'), 'shop_info' => url('/shop_info'), 'success' => url('/success'), 'widge_success' => array());
$shop_id = Auth::user()->shop_id;
$orders = Order::where('shop_id', $shop_id)->where('state_of_shop', 3)->get();
$data['widge_success']['deal_count'] = count($orders);
$data['widge_success']['deal'] = array();
$shop = Shop::find($shop_id);
foreach ($orders as $order) {
$comment = CommentOrder::where('order_id', $order->id)->get();
$one = array('deal_id' => $order->id, 'deal_statue' => $order->state, 'same_again' => '##', 'deal_again' => '##', 'shop_name' => $shop->name, 'deal_number' => $order->number, 'deal_time' => date('Y-m-d', $order->ordertime), 'deal_phone' => $shop->linktel, 'deliver_address' => $order->receive_address, 'deliver_phone' => $order->receive_phone, 'deliver_remark' => $order->beta, 'deal_speed' => isset($comment[0]) ? $comment[0]->speed : 0, 'deal_satisfied' => isset($comment[0]) ? $comment[0]->value : 0, 'good' => array(), 'others' => array(array('item_name' => '不知道', 'item_value' => '-5', 'item_amount' => '1', 'item_total' => '0')));
$one['total'] = $order->total;
$menu_ids = array_count_values(explode(',', $order->order_menus));
foreach ($menu_ids as $menu_id => $amount) {
$menuComment = CommentMenu::where('order_id', $order->id)->where('menu_id', $menu_id)->get();
$menu = Menu::find($menu_id);
//var_dump($menuComment);
$onemenu = array('goods_id' => $menu_id, 'goods_name' => $menu->title, 'goods_value' => $menu->price, 'goods_amount' => $amount, 'goods_total' => $amount * $menu->price, 'good_atisfied' => isset($menuComment[0]) ? $menuComment[0]->value : 0);
array_push($one['good'], $onemenu);
}
array_push($data['widge_success']['deal'], $one);
}
return View::make("template.success.success")->with($data);
//var_dump($data);
}
示例2: ProductPrices
public static function ProductPrices()
{
$param = func_get_args();
if (@$param[0] != null) {
if ($param[0] == 'todays') {
$orders = Order::where('days', date('Y-m-d'))->get();
} else {
if ($param[0] == 'months') {
$orders = Order::where('months', date('Y-m'))->get();
} else {
if ($param[0] == 'years') {
$orders = Order::where('years', date('Y'))->get();
} else {
$orders = Order::all();
}
}
}
if (count($orders) > 0) {
$priceall = 0;
foreach ($orders as $order) {
$otplist = OrderToProduct::where('order_id', $order->id)->get();
foreach ($otplist as $value) {
$priceall += $value->number * self::ProductInfo($value->product_id, 'price');
}
}
return $priceall;
} else {
return 0;
}
} else {
return 0;
}
}
示例3: store
public function store()
{
// 2.1 Retrieve Parameters to variables
$transidmerchant = \Input::get('TRANSIDMERCHANT');
$totalamount = \Input::get('AMOUNT');
$storeid = \Input::get('STOREID');
$status = false;
if ($_SERVER['REMOTE_ADDR'] == '103.10.128.11') {
// 2.2 Cross check with MYSHORTCART Database Table
// $true = 1 : transaction found, 0 : transaction not found
$order = \Order::where('kodeOrder', $transidmerchant)->first();
if ($order) {
//check amount is valid + admin ofcourse!
$doku_akun = \DokuAccount::where('akunId', $order->akunId)->first();
$total_order = $order->total + $order->dokuFee;
if ($totalamount == $total_order) {
$status = true;
} else {
$status = false;
}
}
}
if ($status == true) {
echo 'Continue';
} else {
echo 'Stop';
}
}
示例4: getIndex
public function getIndex()
{
$order_years = Order::where('years', date('Y'))->get();
$order_months = Order::where('months', date('Y-m'))->get();
$order_days = Order::where('days', date('Y-m-d'))->get();
$order_all = Order::all();
return View::make('home', compact('order_years', 'order_months', 'order_days', 'order_all'))->with('title', 'Anasayfa');
}
示例5: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
$order = Order::find($id);
$order = Order::findOrFail($id);
$orders = Order::where('cliente', '=', $id)->get();
$user = $order->user();
$orders = $user->orders();
}
示例6: search
function search($email)
{
$user = Order::where('email_id', $email)->first();
if (!empty($user)) {
$orderitem = new Orderitem();
$data = $orderitem->getOrderbyemail($email);
} else {
$data['message'] = "no data found";
}
return Response::json($data, 400);
}
示例7: adminSection
public function adminSection()
{
$adminId = Session::get('admin_id');
if (!isset($adminId)) {
return Redirect::to('/');
}
$orderCount = Order::where('status', '=', 'pending')->count();
$userCount = User::where('status', '=', 'active')->count();
$softwareUserCount = SoftwareUser::where('status', '=', 'active')->count();
$complaintCount = Complaint::whereIn('status', array('Complaint', 'Problem'))->count();
return View::make('admin.admin-section')->with('orderCount', $orderCount)->with('userCount', $userCount)->with('complaintCount', $complaintCount)->with('softwareUserCount', $softwareUserCount);
}
示例8: onGetEditInput
public function onGetEditInput($formField, array &$row)
{
if ($row) {
if ($formField->getFieldName() == 'products') {
$order = \Order::where("id", $row['id'])->first();
if (isset($order->id)) {
$orderProducts = $order->products();
return View::make('partials.order_products', compact('orderProducts'));
}
}
}
}
示例9: deleteUser
public function deleteUser($id)
{
$user = $this->_getUserById($id);
if ($user) {
\Order::where('user_id', $user->id)->update(['status' => 0]);
$user->update(['status' => 0]);
return true;
} else {
$this->setErrors(['Whoops, something went wrong. Please try again']);
return false;
}
}
示例10: getDatatable
/**
* getDatatable
*/
public function getDatatable()
{
$collection = Order::where('order_status', 'order_stockuped')->get();
return Datatable::collection($collection)->showColumns('date', 'no', 'customer', 'status', 'actions')->orderColumns('date', 'customer')->searchColumns('date', 'no', 'customer')->addColumn('date', function ($model) {
return date('Y-m-d', strtotime($model->created_at));
})->addColumn('customer', function ($model) {
return $model->customer->name;
})->addColumn('status', function ($model) {
return get_order_status($model->order_status);
})->addColumn('actions', function ($model) {
return $str = '<button data-id="' . $model->id . '" class="btn btn-info btn-stockorder">查看货品</button>';
})->make();
}
示例11: success
public function success()
{
if (Input::get("token") && Input::get("PayerID")) {
$token = Input::get('token');
$update = Order::where('token', '=', $token)->update(array("status" => 1));
$order = Order::where('token', '=', $token)->first();
$items = Orderitem::where('order_id', '=', $order->id)->get();
foreach ($items as $item) {
$qt = $item->item_qt;
Product::where('id', '=', $item->item_id)->decrement('stock', $qt);
}
return Redirect::to('product/all')->with('message', 'Votre commande a été passé !');
}
}
示例12: show
public function show()
{
$addresses = Useradd::where('user_id', '=', Auth::user()->id)->get();
$orders = Order::where('orders.user_id', '=', Auth::user()->id)->leftJoin('user_adds as shipadd', 'orders.add_id', '=', 'shipadd.id')->leftJoin('user_adds as rcpadd', 'orders.rcp_id', '=', 'rcpadd.id')->select('orders.*', 'shipadd.title AS ship_title', 'shipadd.address AS ship_add', 'shipadd.address2 AS ship_add2', 'shipadd.postal AS ship_post', 'shipadd.city AS ship_city', 'shipadd.first_name AS ship_first', 'shipadd.last_name AS ship_last', 'rcpadd.title AS rcp_title', 'rcpadd.address AS rcp_add', 'rcpadd.address2 AS rcp_add2', 'rcpadd.postal AS rcp_post', 'rcpadd.city AS rcp_city', 'rcpadd.first_name AS rcp_first', 'rcpadd.last_name AS rcp_last')->orderBy('orders.date', 'DESC')->get();
// on va récupérer les produits de chaque commande
// commence par récupérer l'id de chaque commande
$orders_id = Order::where('orders.user_id', '=', Auth::user()->id)->select('orders.id')->orderBy('orders.date', 'DESC')->get();
$items = array();
// rangés par commandes
foreach ($orders_id->toArray() as $row => $ord) {
$i = Orderitem::where('order_id', '=', $ord['id'])->leftJoin('products', 'order_items.item_id', '=', 'products.id')->select('order_items.*', 'products.name', 'products.picture')->get();
$items[$ord['id']] = $i->toArray();
}
return View::make('user/show', array('addresses' => $addresses, 'orders' => $orders, 'items' => $items));
}
示例13: profile
/**
* Display the customer's profile page after successful login.
*/
public function profile(Customer $customer = NULL)
{
if (is_null($customer)) {
if (Auth::check()) {
//echo Auth::user()->email;
$customer = Customer::find(Auth::id());
$orders = Order::where('customer_id', '=', Auth::id())->get();
$this->layout->content = View::make('customers.profile', compact('customer', 'orders'));
} else {
return Redirect::to('login');
}
} else {
$orders = Order::where('customer_id', '=', $customer->id)->get();
$this->layout->content = View::make('customers.profile', compact('customer', 'orders'));
}
}
示例14: store
public function store()
{
// 2.1 Retrieve Parameters to variables
$transidmerchant = \Input::get('TRANSIDMERCHANT');
$statuscode = \Input::get('STATUSCODE');
$transdate = \Input::get('TRANSDATE');
$ptype = \Input::get('PTYPE');
$totalamount = \Input::get('AMOUNT');
$result = strtoupper(\Input::get('RESULT'));
$xtrainfo = strtoupper(\Input::get('EXTRAINFO'));
$status = false;
$order = \Order::where('kodeOrder', $transidmerchant)->first();
if ($order) {
echo "Order tidak ditemukan..";
}
if ($_SERVER['REMOTE_ADDR'] == '103.10.128.11') {
// 2.2 Cross check with MYSHORTCART Database Table
// $true = 1 : transaction found, 0 : transaction not found
if ($result == 'SUCCESS') {
//update order ke pembayaran diterima
$order->status = 2;
$order->save();
$detail_konfirmasi = '<p>Doku MyshopCart Detail:<br> MerchantId : ' . $transidmerchant . '<br> Total : ' . $amount . '<br> Tanggal : ' . $transdate . '</p>';
$setting = \Pengaturan::where('akunId', '=', $order->akunId)->first();
$data = array('pelanggan' => $order->nama, 'pelangganalamat' => $order->alamat, 'pelangganphone' => $order->telp, 'toko' => $setting->nama, 'kodeorder' => $order->kodeOrder, 'tanggal' => $order->tanggalOrder, 'namaPengirim' => $order->konfirmasi == null ? '-' : $order->konfirmasi->nama, 'noRekening' => $order->konfirmasi == null ? '-' : $order->konfirmasi->noRekPengirim, 'rekeningTujuan' => $order->konfirmasi == null ? '-' : $order->konfirmasi->bank->atasNama . '<br>' . $order->konfirmasi->bank->noRekening . ' - ' . $order->konfirmasi->bank->bankdefault->nama, 'jumlah' => $order->konfirmasi == null ? '-' : $order->konfirmasi->jumlah, 'cart' => \View::make('admin.order.detailorder')->with('order', $order), 'namaEkspedisi' => $order->jenisPengiriman, 'noResi' => $order->noResi, 'tujuanPengiriman' => $order->alamat . ' - ' . $order->kota, 'linkRegistrasi' => \URL::to('member/create'), 'detailKonfirmasi' => $detail_konfirmasi);
$order->fromEmail = $setting->email;
$order->fromtoko = $setting->nama;
$qtyProduk = $order->detailorder;
$template = \Templateemail::where('akunId', '=', $order->akunId)->where('no', '=', 6)->first();
$email = bind_to_template($data, $template->isi);
$subject = bind_to_template($data, $template->judul);
$a = \Mail::send('emails.email', array('data' => $email, 'nama' => '', 'web' => '', 'email' => '', 'telp' => '', 'jmlProduk' => '', 'metatag' => 0), function ($message) use($subject, $order) {
$message->from($order->fromEmail, $order->fromtoko);
$message->to($order->pelanggan->email, $order->pelanggan->nama)->cc($order->fromEmail)->subject($subject);
});
}
}
$akun = \Akun::find($order->akunId);
if ($akun->alamatWeb != '') {
$url = 'http://' . $akun->alamatWeb . '/konfirmasiorder/' . $order->id;
} else {
$url = 'http://' . $akun->alamatJarvis . '.' . \Config::get('app.domain') . '/konfirmasiorder/' . $order->id;
}
echo "Status : " . $status . " <a href='{$url}'> Klik disini jika halaman tidak terload..</a>";
return \Redirect::to($url)->with('message', 'Success Update Order');
}
示例15: orderPay
/**
* ------------ Payment Make on a Order ----------.
*
* @param int $id
* @return Response
*/
public function orderPay()
{
$input = Input::all();
$payment = array('supplier_id' => $input['payOrderSuppId'], 'order_id' => $input['payOrderId'], 'comment' => "Paid on Order-" . $input['payOrderId'], 'ammount' => $input['payOrderPay'], 'date' => $input['payOrderDate']);
if ($input['payOrderPay'] > 0) {
$order = PaySupp::create($payment);
if ($order->exists) {
$upDue = Order::where('id', '=', $input['payOrderId'])->update(array('due' => $input['payOrderDue'], 'pay' => $input['payOrderCurPay']));
if ($upDue) {
return json_encode(array('pay' => 1, 'order' => 1, 'error' => 0));
} else {
return json_encode(array('pay' => 1, 'order' => 0, 'error' => 0));
}
}
} else {
return json_encode(array('pay' => 0, 'order' => 0, 'error' => 1));
}
}