当前位置: 首页>>代码示例>>PHP>>正文


PHP Food::where方法代码示例

本文整理汇总了PHP中Food::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Food::where方法的具体用法?PHP Food::where怎么用?PHP Food::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Food的用法示例。


在下文中一共展示了Food::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit_get

 public function edit_get($id)
 {
     $this->_data['data'] = Food::where("food_id", $id)->first();
     return View::make("admin.content.food.edit", $this->_data)->with("titlePage", "Edit Food")->with("titleTable", "Sửa món ăn tại nhà hàng");
 }
开发者ID:quanit94,项目名称:ABCKitchen,代码行数:5,代码来源:FoodController.php

示例2: function

 // sayfalı son yemekler
 $this->get('/all/{page:[0-9]+}', function ($request, $response, $args) {
     $food = Food::select('food_id', 'name', 'description')->where('deleted', 0)->take(6)->offset($args['page'] * 6)->orderBy('food_id', 'DESC')->get();
     if ($food) {
         return $response->write(json_encode($food) . '     ');
     }
     return $response->write('{"msg": "ERR"}');
 })->setName('foods');
 // sayfalı son yemekler
 $this->get('/popular/{page:[0-9]+}', function ($request, $response, $args) {
     $food = Food::take(6)->offset($args['page'] * 6)->orderBy('displayed', 'DESC')->get();
     return $response->write(json_encode($food) . '     ');
 })->setName('popular_foods');
 // id'den yemek
 $this->get('/{id:[0-9]+}', function ($request, $response, $args) {
     $food = Food::where('food_id', $args['id'])->where('deleted', 0)->get()->first();
     $food->displayed = $food->displayed + 1;
     $food->save();
     if ($food) {
         $food->user = $food->profile();
         return $response->write(json_encode($food) . '     ');
     }
     return $response->write('{"msg": "ERR"}');
 })->setName('food_detail');
 // yemeğe yapılan yorumlar
 $this->get('/{id:[0-9]+}/comments/{page:[0-9]+}', function ($request, $response, $args) {
     $comments = Comment::where('food_id', $args['id'])->where('deleted', 0)->take(10)->offset($args['page'] * 10)->orderBy('comment_id', 'DESC')->get();
     return $response->write(json_encode($comments) . '     ');
 })->setName('food_comments');
 // yemek ekle
 $this->post('', function ($request, $response, $args) {
开发者ID:gokselpirnal,项目名称:WhatTheFood-web,代码行数:31,代码来源:routes.php

示例3: foods

 /**
  *
  * @param $typing
  * @return mixed
  */
 private function foods($typing)
 {
     $foods = Food::where('user_id', Auth::user()->id)->where('name', 'LIKE', $typing)->with('defaultUnit')->with('units')->get();
     return $foods;
 }
开发者ID:JennySwift,项目名称:project-tracker,代码行数:10,代码来源:AutocompleteController.php


注:本文中的Food::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。