当前位置: 首页>>代码示例>>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;未经允许,请勿转载。