本文整理汇总了PHP中Order::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::all方法的具体用法?PHP Order::all怎么用?PHP Order::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
示例2: getList
public function getList($date)
{
$limit = 12;
if ($date == 'today') {
$datename = "Bu <u>gün</u>e ait olan";
$list = Order::orderBy('id', 'desc')->where('status', 1)->where('days', date('Y-m-d'))->paginate($limit);
} else {
if ($date == 'month') {
$datename = "Bu <u>ay</u>a ait olan";
$list = Order::orderBy('id', 'desc')->where('status', 1)->where('months', date('Y-m'))->paginate($limit);
} else {
if ($date == 'year') {
$datename = "Bu <u>yıl</u>a ait olan";
$list = Order::orderBy('id', 'desc')->where('status', 1)->where('years', date('Y'))->paginate($limit);
} else {
$datename = "Tüm";
$list = Order::orderBy('id', 'desc')->where('status', 1)->paginate($limit);
}
}
}
$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('order.list', compact('list', 'order_years', 'order_months', 'order_days', 'order_all'))->with(['title' => 'Siparişler', 'count_static' => true, 'date_visible' => true, 'price_all' => 0, 'datetime' => $date, 'datename' => $datename]);
}
示例3: index
public function index()
{
require 'models/product.php';
require_once 'models/order_detail.php';
$orders = Order::all();
require_once 'views/orders/index.php';
}
示例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: listOfBuyerOrderCakes
public function listOfBuyerOrderCakes()
{
// $buyer = Buyer::orderBy('created_at', 'desc')->first();
// $name = $buyer->name;
// $order = Order::where('buyersName', '=', $name)->get();
// $cakes = Cake::all();
//$order = DB::SELECT(DB::RAW("SELECT * FROM order"));
$orders = Order::all();
// var_dump($order);
return View::make('myaccountBuyer', ['orders' => $orders]);
}
示例6: delivery
public function delivery()
{
$djt = Delivery::with('employee')->join('tblOrders', function ($join) {
$join->on('tblDeliveries.strOrdDlvry', '=', 'tblOrders.strOrdersID');
})->join('tblSuppliers', function ($join3) {
$join3->on('tblOrders.strSupplID', '=', 'tblSuppliers.strSuppID');
})->get();
$ids = DB::table('tblDeliveries')->select('strDlvryID')->orderBy('updated_at', 'desc')->orderBy('strDlvryID', 'desc')->take(1)->get();
$ID = $ids["0"]->strDlvryID;
$newID = $this->smart($ID);
$orders = Order::all();
$op = OrderProduct::all();
$ord = Order::lists('strOrdersID', 'strOrdersID');
$products = Product::lists('strProdName', 'strProdID');
$data = array('orders' => $ord, 'products' => $products);
return View::make('delivery')->with('djt', $djt)->with('newID', $newID)->with('orders', $orders)->with('op', $op)->with('data', $data);
}
示例7: run
public function run()
{
$faker = $this->getFaker();
$orders = Order::all();
$products = Product::all()->toArray();
foreach ($orders as $order) {
$used = [];
for ($i = 0; $i < rand(1, 5); $i++) {
$product = $faker->randomElement($products);
if (!in_array($product["id"], $used)) {
$id = $product["id"];
$price = $product["price"];
$quantity = rand(1, 3);
OrderItem::create(["order_id" => $order->id, "product_id" => $id, "price" => $price, "quantity" => $quantity]);
$used[] = $product["id"];
}
}
}
}
示例8: getIndex
public function getIndex()
{
$super = 0;
$vendor = 0;
if (isset($_GET['vendor']) && $_GET['vendor']) {
$affected = Order::where('vendor_id', '=', Auth::user()->id)->update(array('notification' => 0));
$vendor = 1;
$orders = Order::where('vendor_id', '=', Auth::user()->id)->get();
return View::make('orders.index')->with('orders', $orders)->with('super', $super)->with('vendor', $vendor);
} else {
if (isset($_GET['super']) && $_GET['super'] && Auth::user()->isSuper) {
$super = 1;
$orders = Order::all();
$ordermasters = Ordermaster::all();
return View::make('orders.index')->with('orders', $orders)->with('ordermasters', $ordermasters)->with('super', $super)->with('vendor', $vendor);
} else {
$data_set = DB::table('orders')->leftJoin('ratings', 'orders.order_id', '=', 'ratings.odr_id')->where('orders.user_id', '=', Auth::user()->id)->get();
return View::make('orders.userindex')->with('orders', $data_set)->with('super', $super)->with('vendor', $vendor);
}
}
//return View::make('orders.index');
}
示例9: orders
/**
* @before _secure
*/
public function orders()
{
$this->seo(array("title" => "Orders", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$orders = array();
$os = Order::all(array("user_id = ?" => $this->user->id), array("id", "amount", "ref_id"), "created", "desc");
foreach ($os as $o) {
$title = array();
$appointments = Appointment::all(array("order_id = ?" => $o->id), array("service_id", "start", "end", "patient_id"));
foreach ($appointments as $a) {
$service = Service::first(array("id = ?" => $a->service_id), array("property", "property_id"));
$model = ucfirst($service->property);
$item = $model::first(array("id = ?" => $service->property_id), array("title"));
$title[] = $item->title;
$start = $a->start;
$end = $a->end;
$patient_id = $a->patient_id;
}
$patient = User::first(array("id = ?" => $patient_id), array("name"));
array_push($orders, array("item" => implode(", ", $title), "amount" => $o->amount, "id" => $o->id, "ref_id" => $o->ref_id, "patient" => $patient->name, "start" => $start, "end" => $end));
}
$view->set("orders", $orders);
}
示例10: get_export
/**
* get_export
* saved to public folder
*
* @access public
* @return void
*/
function get_export()
{
$table = Order::all();
$file = fopen('file.csv', 'w');
foreach ($table as $row) {
fputcsv($file, $row->toarray());
}
fclose($file);
//return Redirect::to('consolidated');
}
示例11: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$orders = Order::all();
return View::make('order.index')->with('orders', $orders);
}
示例12: user_index
public static function user_index()
{
return function ($request, $response) {
if (!$request->session('admin')) {
$user_id = $request->session('id');
$orders = Order::findByUser($user_id);
if (!$user_id) {
$response->code(403);
} else {
if ($orders) {
$response->json($orders->as_array());
} else {
$response->json(array());
}
}
} else {
$order = Order::all();
$response->json($order->as_array());
}
};
}
示例13: index
/**
* Display a listing of orders
*
* @return Response
*/
public function index()
{
$orders = Order::all();
return View::make('orders.index', compact('orders'));
}
示例14: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return Response::json($this->order->all());
}
示例15: getOrder
public function getOrder()
{
$orders = Order::all();
return View::make('admin.order')->with('orders', $orders);
}