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


PHP Misc::where方法代码示例

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


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

示例1: index

 public function index()
 {
     $projects = Project::orderBy('sortorder')->get();
     $miscs = Misc::all();
     $bio = Misc::where('name', '=', 'bio')->firstOrFail();
     $resumeURL = Misc::where('name', '=', 'resumeURL')->firstOrFail();
     $githubURL = Misc::where('name', '=', 'githubURL')->firstOrFail();
     return View::make('projects.index')->with('projects', $projects)->with('bio', $bio)->with('resumeURL', $resumeURL)->with('githubURL', $githubURL);
 }
开发者ID:jcstrandburg,项目名称:portfoliowriter,代码行数:9,代码来源:ProjectsController.php

示例2: getMyPurchase

 public function getMyPurchase($id)
 {
     $title = "Factura";
     $fac = Facturas::find($id);
     $user = User::find($fac->user_id);
     $aux = FacturaItem::where('factura_id', '=', $id)->get(array('item_id', 'item_qty'));
     $i = 0;
     foreach ($aux as $a) {
         $b = Items::find($a->item_id);
         $b->qty = $a->item_qty;
         $aux = Misc::where('item_id', '=', $a->item_id)->where('deleted', '=', 0)->first();
         $b->img = Images::where('misc_id', '=', $aux->id)->where('deleted', '=', 0)->first();
         $item[$i] = $b;
         $i++;
     }
     return View::make('user.factura')->with('fact', $item)->with('title', $title)->with('user', $user)->with('factura', $fac);
 }
开发者ID:bakuryuthem0,项目名称:nia,代码行数:17,代码来源:UserController.php

示例3: getShowItem

 public function getShowItem($id)
 {
     $art = Items::where('item.id', '=', $id)->first(array('item.*'));
     $a = new stdClass();
     $a->id = $art->id;
     $a->item_nomb = $art->item_nomb;
     $a->item_desc = $art->item_desc;
     $a->item_cod = $art->item_cod;
     $a->item_precio = $art->item_precio;
     if (!is_null($art->percent)) {
         $a->percent = $art->percent;
     }
     $a->misc = array();
     $a->tallas = array();
     $a->colores = array();
     //$misc    			= Misc::where('item_id','=',$art->id)->first();
     $misc = Misc::where('item_id', '=', $art->id)->get();
     $aux = array();
     $i = 0;
     foreach ($misc as $m) {
         $aux[$i] = Images::where('misc_id', '=', $m->id)->where('deleted', '=', 0)->get();
         $i++;
     }
     $a->images = $aux;
     $t = Misc::where('item_id', '=', $art->id)->groupBy('item_talla')->get(array('item_talla'));
     $c = Misc::where('item_id', '=', $art->id)->get(array('item_color', 'item_talla'));
     $a->tallas = $t;
     $a->colores = $c;
     $tallas = Tallas::get();
     $colores = Colores::get();
     $title = $art->item_nomb;
     if (Auth::check() && Auth::user()->role == 1) {
         $layout = 'admin';
     } else {
         $layout = 'default';
     }
     $option = array();
     $tallas = Tallas::get();
     $colores = Colores::get();
     return View::make('indexs.artSelf')->with('title', $title)->with('art', $a)->with('layout', $layout)->with('tallas', $tallas)->with('colores', $colores);
 }
开发者ID:bakuryuthem0,项目名称:nia,代码行数:41,代码来源:HomeController.php

示例4: foreach

    $images = Image::all();
    $html = "";
    foreach ($images as $image) {
        $source = $image->url;
        $dest = public_path() . "/thumbs/" . $image->id . ".jpg";
        $html .= "Source: " . $image->url . " --- Dest: {$dest}<br>";
        make_thumb($source, $dest, 100);
    }
    return $html;
});
Route::get('publish', function () {
    ob_start();
    $projects = Project::orderBy('sortorder')->get();
    $bio = Misc::where('name', '=', 'bio')->firstOrFail();
    $resumeURL = Misc::where('name', '=', 'resumeURL')->firstOrFail();
    $githubURL = Misc::where('name', '=', 'githubURL')->firstOrFail();
    $images = Image::all();
    foreach ($images as $image) {
        $source = $image->url;
        $dest = public_path() . "/thumbs/{$image->id}.jpg";
        echo "Writing thumbnail {$dest}...";
        if (make_thumb($source, $dest, 200)) {
            echo "success";
            $image->thumbnail = asset("thumbs/{$image->id}.jpg");
        } else {
            echo "failure";
            $image->thumbnail = $source;
        }
        $image->save();
        echo "<br>";
    }
开发者ID:jcstrandburg,项目名称:portfoliowriter,代码行数:31,代码来源:routes.php

示例5: getProcesePurchase

 public function getProcesePurchase($id)
 {
     $title = "Metodo de pago | Nia Boutique.com";
     $fac = Facturas::find($id);
     $x = FacturaItem::where('factura_id', '=', $id)->sum('item_qty');
     $aux = FacturaItem::where('factura_id', '=', $id)->get(array('item_id', 'item_qty', 'item_talla', 'item_color', 'item_precio'));
     $i = 0;
     $auxT = 0;
     $auxQ = 0;
     $p = '';
     foreach ($aux as $a) {
         $b = Items::where('item.id', '=', $a->item_id)->first();
         $p = $p . $b->item_nomb . ', ';
         $b->qty = $a->item_qty;
         $b->precio = $a->item_precio;
         $b->item_talla = Tallas::where('id', '=', $a->item_talla)->pluck('talla_desc');
         $b->item_color = Colores::where('id', '=', $a->item_color)->pluck('color_desc');
         $auxT = $auxT + $b->qty * $b->item_precio;
         $auxQ = $auxQ + $b->qty;
         $aux = Misc::where('item_id', '=', $a->item_id)->where('deleted', '=', 0)->first();
         $b->img = Images::where('misc_id', '=', $aux->id)->where('deleted', '=', 0)->first();
         $item[$i] = $b;
         $i++;
     }
     $total = 0;
     $method = 'hola';
     $bancos = Bancos::where('deleted', '=', 0)->get();
     return View::make('indexs.showCart')->with('title', $title)->with('method', $method)->with('total', $total)->with('items', $item)->with('id', $id)->with('bancos', $bancos);
 }
开发者ID:bakuryuthem0,项目名称:nia,代码行数:29,代码来源:ItemController.php

示例6: getNewImgPos

 public function getNewImgPos($id)
 {
     $title = "Cambiar posición de las imagenes";
     $item = Items::find($id);
     $misc = Misc::where('item_id', '=', $item->id)->get(array('id'));
     $images = array();
     $j = 0;
     foreach ($misc as $m) {
         $x = Images::where('misc_id', '=', $m->id)->where('deleted', '=', 0)->get(array('id', 'misc_id', 'image', 'order'));
         foreach ($x as $y) {
             $aux = new stdClass();
             $aux->id = $y->id;
             $aux->misc_id = $y->misc_id;
             $aux->image = $y->image;
             $aux->order = $y->order;
             $images[$j] = $aux;
             $j++;
         }
     }
     for ($i = 0; $i < count($images); $i++) {
         for ($j = 0; $j < count($images) - 1; $j++) {
             if ($images[$j]->order > $images[$j + 1]->order) {
                 $bub = new stdClass();
                 $bub = $images[$j + 1];
                 $images[$j + 1] = $images[$j];
                 $images[$j] = $bub;
             }
         }
     }
     return View::make('admin.changeImagePos')->with('title', $title)->with('item', $images);
 }
开发者ID:bakuryuthem0,项目名称:nia,代码行数:31,代码来源:AdminController.php


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