1. PHP / Говнокод #9705

    +145

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    $sortBy = "";
            if ( isset($_REQUEST['sortBy']) && ! empty($_REQUEST['sortBy'])) {
            // Get sort direction and field sort.
                $sortByParts  = explode("-", $_REQUEST['sortBy']);
                if ( is_array($sortByParts) && ! empty($sortByParts[0]) && ! empty($sortByParts[1])) {
                    $sortBy     = $sortByParts[0];
                    $direction  = $sortByParts[1];
                }   
            } 
    switch ($sortBy)
                case "discount":
                    $sortFieldBy = $sortBy;
                    break;
                case "created":
                    $sortFieldBy = $sortBy;
                    break;
                case "vendor":
                    $sortFieldBy = $sortBy;
                    break;
                case "actual_euprice":
                    $sortFieldBy = $sortBy;
                    break;
                case "actual_euprice":
                    $sortFieldBy = $sortBy;
                    break;                
                case "top_sell_product":                
                default:
                    $search->addAdditionalJoins(
                        "top_sell_product",
                        array("top_sell_product.prodlevid" => "p.prodlevid"),
                        SEARCH_ADDITIONAL_JOIN_TYPE_INNER,
                        array()
                    );

    Очередная самописная CMS.

    Запостил: zii, 18 Марта 2012

    Комментарии (1) RSS

    Добавить комментарий