Skip to content

Instantly share code, notes, and snippets.

View PorraphitChuasuk's full-sized avatar

Poraphit.c PorraphitChuasuk

View GitHub Profile
SET @entityid = 5; -- category's ID
-- Select varchar/string based category attribute values
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav ON e.entity_id = eav.entity_id
JOIN eav_attribute ea ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
-- Select integer based category attribute values (includes boolean values)
UNION(
@PorraphitChuasuk
PorraphitChuasuk / convBase.php
Created March 5, 2018 12:50 — forked from macik/convBase.php
Convert an arbitrarily large number from any base to any base.
<?php
/*
Convert an arbitrarily large number from any base to any base.
string convBase(string $numberInput, string $fromBaseInput, string $toBaseInput)
$numberInput number to convert as a string
$fromBaseInput base of the number to convert as a string
$toBaseInput base the number should be converted to as a string
examples for $fromBaseInput and $toBaseInput
@PorraphitChuasuk
PorraphitChuasuk / mage_get_select_count_sql_distinct.md
Created January 30, 2018 09:30 — forked from evgv/mage_get_select_count_sql_distinct.md
Magento. Rewrited getSelectCountSql() method, added DISTINCT form GROUP_BY param.
    /**
     * Get SQL for get record count
     * 
     * Rewrited for GROUP_BY
     * @return Varien_Db_Select
     */
    public function getSelectCountSql()
    {   
 $this-&gt;_renderFilters();
@PorraphitChuasuk
PorraphitChuasuk / composer.json
Created January 4, 2018 11:45 — forked from andyshinn/composer.json
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}