XF 2.1 $finder->order doesn't sort the data with order

hemant_bhardwaj

Well-known member
well i am trying to get data by integer value of spinbox of xenforo and it's work very well with the number between 1 to 9 but if we add something like 100 and 110 so it's doesn't sort it.
for example
i am getting 1 , 100 , 110 , 2 ,3
but the needed result is - 1 , 2, 3, 100 , 110
any mistake or something i am missing ?
My code
Code:
$finder = \XF::finder('xenbros\Supergetter:Aspingtool');    
         $viewParams = $finder->order('supergetter_position', 'ASC')->fetch();
 
thanks for the reply bro :) - there the entity
Code:
 $structure->table = 'xf_supergetter_tool';
    $structure->shortName = 'xenbros\Supergetter:Aspingtool';
    $structure->primaryKey = 'supergetter_id';
    $structure->columns = [
        'supergetter_id' => ['type' => self::UINT, 'autoIncrement' => true,  'nullable' => true, 'changeLog' => false, 'required' => true],
        'supergetter_title' => ['type' => self::UINT, 'required' => true],
        'supergetter_url' => ['type' => self::UINT, 'required' => true],
        'supergetter_icon' => ['type' => self::UINT, 'required' => true],
        'supergetter_back_color' => ['type' => self::UINT, 'required' => true],
        'supergetter_font_color' => ['type' => self::UINT, 'required' => true],
        'supergetter_open_link' => ['type' => self::UINT, 'required' => true],
        'supergetter_position' => ['type' => self::UINT, 'required' => true],
    ];
    $structure->getters = [];
    $structure->relations = [];

    return $structure;
 
Problem is supergetter_position is a not an int column type and by structure, I meant something like this:196932
 
ahh sorry i miss that. :( it's in that varchar(255) aww man some time silly mistake hurt you more then big errors :p
thanks bro
does i need to change it in the setup with he method ?
$table->addColumn('supergetter_position', 'int');
i think yes :/
 
Back
Top Bottom