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


PHP Color::where方法代码示例

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


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

示例1: postEditacolor

 public function postEditacolor($id)
 {
     $material_color = MaterialColor::find($id);
     $color = Color::where('id', $material_color->color_id)->firstorfail();
     $color->nombre = Input::get('nombre_color');
     $color->save();
     $material = MaterialColor::where('id', $material_color->id)->firstorfail();
     $material_color->material_id = Input::get('material_id');
     $material->save();
     return Redirect::action('InventarioRecubControlador@getColores');
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:11,代码来源:InventarioRecubControlador.php

示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($palette_id, $color_id)
 {
     try {
         $color = Color::where('palette_id', $palette_id)->findOrFail($color_id);
         $color->fill(Input::all());
         $color->validate();
         $color->save();
         return $this->respondOK(['data' => $this->transformer->transform($color)]);
     } catch (ModelNotFoundException $e) {
         return $this->respondNotFound();
     } catch (ValidationException $e) {
         return $this->respondNotAcceptable($e->getMessage());
     } catch (Exception $e) {
         return $this->respondBadRequest($e->getMessage());
     }
 }
开发者ID:aaronbullard,项目名称:litmus,代码行数:22,代码来源:ColorController.php

示例3: saveTemplate

 public function saveTemplate($truth_name, $tpl_name = '', $temptype = 0)
 {
     if ($tpl_name != '') {
         $tpl_exists = Template::where('name', $tpl_name)->first();
         if ($tpl_exists) {
             $unpack_resuslt = $this->unpack($truth_name, $tpl_name, true, $temptype);
         } else {
             $tpl_exists = false;
             $unpack_resuslt = $this->unpack($truth_name, $tpl_name, true, $temptype);
         }
     } else {
         $tpl_exists = false;
         $unpack_resuslt = $this->unpack($truth_name, $tpl_name, false, $temptype);
     }
     if ($unpack_resuslt) {
         $tpl_info = $unpack_resuslt['config'];
         if ($tpl_exists) {
             $template = Template::find($tpl_exists->id);
         } else {
             $template = new Template();
             $template->name = $unpack_resuslt['tpl_dir'];
             $template->tpl_num = $unpack_resuslt['tpl_num'];
         }
         $template->tpl_name = $tpl_info['template']['tpl_name'];
         $template->classify = $tpl_info['template']['classify'];
         $template->demo = $tpl_info['template']['demo'];
         $template->type = $tpl_info['template']['type'];
         $template->description = $tpl_info['template']['description'];
         $template->list1showtypetotal = $tpl_info['template']['list1showtypetotal'];
         $template->list2showtypetotal = $tpl_info['template']['list2showtypetotal'];
         $template->list3showtypetotal = $tpl_info['template']['list3showtypetotal'];
         $template->list4showtypetotal = $tpl_info['template']['list4showtypetotal'];
         $template->updated_at = date("Y-m-d H:i:s", time());
         $insert_rst = $template->save();
         if ($insert_rst) {
             $insert_id = $template->id;
             $color_arr = $tpl_info['tpl_color'];
             $tpl_color = array();
             $i = 0;
             TemplateToColor::where('template_id', $insert_id)->delete();
             if (count($color_arr) > 0) {
                 foreach ($color_arr as $color) {
                     $tpl_color[$i]['template_id'] = $insert_id;
                     $tpl_color[$i]['color_code'] = Config::get('color.' . $color);
                     $tpl_color[$i]['color_id'] = Color::where('color_en', $color)->pluck('id');
                     $i++;
                 }
                 TemplateToColor::insert($tpl_color);
             }
         }
         $result = ['err' => 1000, 'msg' => '上传模板成功'];
     } else {
         $result = ['err' => 1003, 'msg' => '解压文件失败'];
     }
     return $result;
 }
开发者ID:baiduXM,项目名称:gbpen,代码行数:56,代码来源:WebsiteController.php


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