|
|
@ -274,37 +274,46 @@ class Goods extends BaseModel |
|
|
|
// 排序条件 |
|
|
|
// 排序条件 |
|
|
|
$sort = $this->setQuerySort($param); |
|
|
|
$sort = $this->setQuerySort($param); |
|
|
|
$order = request()->get()['order'] ?? ''; |
|
|
|
$order = request()->get()['order'] ?? ''; |
|
|
|
|
|
|
|
$sort = request()->get()['sort'] ?? ''; |
|
|
|
if (!empty($order)) { |
|
|
|
if ($order && $sort) { |
|
|
|
if ($order == 1) { |
|
|
|
$sort = [ |
|
|
|
$sort = ['goods_price_min' => 'asc']; |
|
|
|
$sort => $order, |
|
|
|
} |
|
|
|
]; |
|
|
|
if ($order == 2) { |
|
|
|
} else { |
|
|
|
$sort = ['goods_price_min' => 'desc']; |
|
|
|
$sort = [ |
|
|
|
} |
|
|
|
$this->getPk() => 'desc', |
|
|
|
|
|
|
|
]; |
|
|
|
if ($order == 3) { |
|
|
|
|
|
|
|
$sort = ['discount' => 'asc']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($order == 4) { |
|
|
|
|
|
|
|
$sort = ['discount' => 'desc']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($order == 5) { |
|
|
|
|
|
|
|
$sort = ['goods_sales' => 'asc']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($order == 6) { |
|
|
|
|
|
|
|
$sort = ['goods_sales' => 'desc']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($order == 7) { |
|
|
|
|
|
|
|
$sort = ['goods_sales' => 'asc']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($order == 8) { |
|
|
|
|
|
|
|
$sort = ['goods_sales' => 'desc']; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// if (!empty($order)) { |
|
|
|
|
|
|
|
// if ($order == 1) { |
|
|
|
|
|
|
|
// $sort = ['goods_price_min' => 'asc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if ($order == 2) { |
|
|
|
|
|
|
|
// $sort = ['goods_price_min' => 'desc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if ($order == 3) { |
|
|
|
|
|
|
|
// $sort = ['discount' => 'asc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if ($order == 4) { |
|
|
|
|
|
|
|
// $sort = ['discount' => 'desc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if ($order == 5) { |
|
|
|
|
|
|
|
// $sort = ['goods_sales' => 'asc']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if ($order == 6) { |
|
|
|
|
|
|
|
// $sort = ['goods_sales' => 'desc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if ($order == 7) { |
|
|
|
|
|
|
|
// $sort = ['goods_sales' => 'asc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// if ($order == 8) { |
|
|
|
|
|
|
|
// $sort = ['goods_sales' => 'desc']; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$field = $this->getAliasFields($this->name, ['content']); |
|
|
|
$field = $this->getAliasFields($this->name, ['content']); |
|
|
|