本文整理汇总了PHP中ProductCategory::where方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductCategory::where方法的具体用法?PHP ProductCategory::where怎么用?PHP ProductCategory::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProductCategory
的用法示例。
在下文中一共展示了ProductCategory::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCategoryDropOptions
public function getCategoryDropOptions()
{
$category_list = array('' => trans('webshoppack::common.select_option'));
$c_data = ProductCategory::where('status', '=', 'active')->orderBy('category_left')->get(array('id', 'category_name', 'category_level'));
foreach ($c_data as $row) {
if ($row['category_level'] != 0) {
$category_list[$row['id']] = $row['category_level'] ? str_repeat(' ', self::MAX_CATEGORY_SPACING * $row['category_level']) . $row['category_name'] : $row['category_name'];
}
}
return $category_list;
}
示例2: deleteExistingImageFiles
public function deleteExistingImageFiles($reference_id)
{
$existing_images = ProductCategory::where('id', '=', $reference_id)->first();
if (count($existing_images) > 0 && $existing_images['image_name'] != '') {
$data_arr = array('image_name' => '', 'image_ext' => '', 'image_height' => '', 'image_width' => '');
$affectedRows = ProductCategory::whereRaw('id = ?', array($reference_id))->update($data_arr);
$this->deleteImageFiles($existing_images['image_name'], $existing_images['image_ext'], \Config::get("webshoppack::product_category_image_folder"));
}
}
示例3: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
if ($this->isAdminRequest()) {
$productcategory = ProductCategory::find($id);
$parents = array('' => 'Select a Parent (if applicable)') + ProductCategory::where('parent_category', '=', 0)->where('id', '!=', $id)->lists('title', 'id');
return View::make('admin.products.edit')->with('productcategory', $productcategory)->with('productcategories', $parents);
}
}