當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vendor::where方法代碼示例

本文整理匯總了PHP中Vendor::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vendor::where方法的具體用法?PHP Vendor::where怎麽用?PHP Vendor::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vendor的用法示例。


在下文中一共展示了Vendor::where方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: edit

 public function edit()
 {
     //Larasset::start('footer')->js('bootstrap-datepicker');
     //Larasset::start('header')->css('bootstrap-datepicker');
     $all = Input::all();
     $id = $all['id'];
     //Lets fetch the updated data and return it through ajax
     $data['row'] = Vendor::where('id', $id)->get()->toArray()[0];
     return View::make('admin.vendor.vendor_edit', $data);
 }
開發者ID:sliekasirdis79,項目名稱:POS,代碼行數:10,代碼來源:AdminVendorController.php

示例2: sendEmail

 public function sendEmail()
 {
     //get all items that are low
     $items = Item::whereRaw('quantity <= email_threshold')->where('active', '=', 1)->get();
     //mails to Coordinators
     $to = implode(', ', DB::table('users')->where('positions_id', '=', 6)->lists('email'));
     //Declares the subject for the email
     $subject = "Low Inventory Update";
     //"From:"" Header
     $headers = 'From: Inventory Updater' . "\r\n";
     //first two lines of the message
     $message = "-Automated message from Inventory Control System-\r\nThe following items need to be ordered:\r\n\r\n\r\n";
     //for each item, it formats the output and adds it to the message
     foreach ($items as $item) {
         $vendorId = Vendor::where('id', '=', $item->vendor_id)->pluck('name');
         $message .= $item->name . " | On-Hand: " . $item->quantity . "\r\n";
         $message .= "Email Threshold set for order prompt at " . $item->email_threshold . " remaining.\r\n";
         $message .= "Order from " . $vendorId . " at " . $item->item_url . "\r\n\r\n";
     }
     //adds the final lines to message.
     $message .= "\r\nThe inventory site can be reached at: https://loftythoughts.me/caeweb/inventory/ \r\n";
     $signature = "\r\n\r\nCAE Center";
     $message .= $signature;
     //sends the email
     mail($to, $subject, $message, $headers);
 }
開發者ID:p-tricky,項目名稱:CAEWeb,代碼行數:26,代碼來源:InventoryApiController.php


注:本文中的Vendor::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。