【发布时间】:2016-04-30 09:59:37
【问题描述】:
我有一个数据类型为 INTEGER 的字段。
我想按 asc 显示产品订单。
1,2,3,4
controller.php
$products = $this->product->getUntrashed('main_category', ucfirst($label), $limit, 'top', 'asc', $min, $max, $designers, $categories, $colors, $availability);
public function getUntrashed($column, $value, $limit = 9, $order, $sort, $min, $max, $designers, $categories, $colors, $availability)
{
return Product::where($column, $value)->whereNull('deleted_at')->where('price', '>=', $min)->where('price', '<=', $max)->where('visibility', '=', 1)->where('stock_count', '!=', 0)->where('status', '!=',0)->orderBy($order, $sort)->paginate($limit);
}
问题是:
使用默认值 0 我无法正确排序。
帮助。
【问题讨论】:
标签: php laravel integer sql-order-by laravel-4.2