|
|
|
|
@ -90,13 +90,15 @@ class ComboController extends Controller
|
|
|
|
|
$sql = $sql . " and a.name like ? ";
|
|
|
|
|
$canshu[] = '%'.$search.'%';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($combo_sort)) {
|
|
|
|
|
$sql = $sql . " order by a.order ";
|
|
|
|
|
}
|
|
|
|
|
if (isset($combo_sort)) {
|
|
|
|
|
if ($combo_sort == 1) {
|
|
|
|
|
$sql = $sql . " ";
|
|
|
|
|
}
|
|
|
|
|
if ($combo_sort == 2) {
|
|
|
|
|
$sql = $sql . " ";
|
|
|
|
|
$sql = $sql . " order by a.sale_count desc";
|
|
|
|
|
}
|
|
|
|
|
if ($combo_sort == 3) {
|
|
|
|
|
$sql = $sql . " order by a.price";
|
|
|
|
|
@ -104,6 +106,12 @@ class ComboController extends Controller
|
|
|
|
|
if ($combo_sort == 4) {
|
|
|
|
|
$sql = $sql . " order by a.price desc";
|
|
|
|
|
}
|
|
|
|
|
if ($combo_sort == 5) {
|
|
|
|
|
$sql = $sql . " order by b.count desc";
|
|
|
|
|
}
|
|
|
|
|
if ($combo_sort == 6) {
|
|
|
|
|
$sql = $sql . " order by b.count ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(isset($keshi_name)){
|
|
|
|
|
@ -139,8 +147,8 @@ class ComboController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$combos = DB::select("select * from combos as a LEFT JOIN (
|
|
|
|
|
select combo_id as c_id,count(*) as count from orders where status in(2,4) group by combo_id
|
|
|
|
|
) as b on a.combo_id=b.c_id where a.status=1 and a.sex in(?,0) " . $sql ." order by a.`order` ", $canshu);
|
|
|
|
|
select combo_id as c_id,count(*) as count from combo_items where status in(1) group by combo_id
|
|
|
|
|
) as b on a.combo_id=b.c_id where a.status=1 and a.sex in(?,0) " . $sql ." ", $canshu);
|
|
|
|
|
|
|
|
|
|
foreach ($combos as $key => $combo) {
|
|
|
|
|
$combo->count=$combo->count?$combo->count:0;
|
|
|
|
|
@ -214,9 +222,11 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
|
|
|
|
|
$crowd = DB::table('combo_crowd')->get();
|
|
|
|
|
$sort_list = [
|
|
|
|
|
["id" => 1, 'name' => '综合排序'],
|
|
|
|
|
["id" => 2, 'name' => '预约最多'],
|
|
|
|
|
["id" => 2, 'name' => '销售最多'],
|
|
|
|
|
["id" => 3, 'name' => '低价优先'],
|
|
|
|
|
["id" => 4, 'name' => '高价优先'],
|
|
|
|
|
["id" => 5, 'name' => '项目最多'],
|
|
|
|
|
["id" => 6, 'name' => '项目最少'],
|
|
|
|
|
];
|
|
|
|
|
$price_list = [
|
|
|
|
|
['name' => '300以下', 'id' => 1],
|
|
|
|
|
|