本文整理汇总了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);
}
示例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);
}