1. Список говнокодов пользователя j488538trbvmcom

    Всего: 1

  2. PHP / Говнокод #19189

    0

    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
    $collections = Yii::app()->db->createCommand()
        ->selectDistinct('prod.product_id,cc.category_id AS id, cc.code AS code,cc.img AS '
            . 'pic,cc.category_name AS name, pl.category_name AS ln_name, '
            . 'fvs.value AS country,c2.category_name AS parent_category,'
            . 'c2.category_id AS p_id, c2.code AS p_code')
    // ->select()
        ->from('Products prod')
        ->join('Products_Categoryes pc', 'prod.product_id = pc.product_id')
        ->join('Categories c', 'c.category_id = pc.category_id')
        ->join('Products_Categoryes ppp', 'ppp.category_id = c.category_id')
        ->join('Products p', 'p.product_id = ppp.product_id')
        ->join('Products_Categoryes pppccc', 'pppccc.product_id = ppp.product_id ')
        ->join('Categories cc', 'cc.category_id = pppccc.category_id
    AND cc.category_left > :cat_left
    AND cc.category_right < :cat_right
    AND cc.category_level = 3', array(':cat_left' => $brends['category_left'], ':cat_right' => $brends['category_right']))
        ->join('Categories c2', 'cc.category_left > c2.category_left
    AND cc.category_right < c2.category_right
    AND c2.category_level = cc.category_level - 1')
        ->leftJoin('kk_categories_ln pl', ' pl.ln_id = :ln '
            . 'AND pl.category_id = cc.category_id', array(':ln' => $ln_id))
        ->leftJoin('Feature_Product_Values fpv', 'p.product_id = fpv.product_id '
            . 'AND feature_id = :country_id ', array(':country_id' => $counrty_id))
        ->leftJoin('Feature_Values_string fvs', 'fvs.feature_id = fpv.feature_id')
        ->group('cc.category_id')
        ->where($where, $params)
        ->queryAll();

    j488538trbvmcom, 15 Декабря 2015

    Комментарии (11)