Okay
  Public Ticket #2481494
Gostaria de fazer um select como o código abaixo, existe alguma forma de fazer pelo plugin WPDataTables?
Closed

Comments

  • 2wins started the conversation

    Gostaria de fazer um select como o código abaixo ou obter os mesmos resultados, existe alguma forma de fazer pelo plugin WPDataTables?


    SET @contador := 0;
    SELECT @contador := @contador + 1 AS linha, 
    crmwp.bd_erp_crm_customer_activities.`created_by`,
           crmwp.bd_erp_crm_customer_activities.`user_id`,
           crmwp.bd_erp_crm_customer_activities.`type`,
           crmwp.bd_erp_crm_customer_activities.`message`,
           crmwp.bd_erp_crm_customer_activities.`created_at`,
           crmwp.bd_erp_crm_customer_activities.`updated_at`,
           concat('<a href="/wp-admin/admin.php?page=erp-crm&section=contacts&action=view&id=', user_id, '" target="_blank">Clique para ir pra Lead</a>') as Link
    FROM crmwp.bd_erp_crm_customer_activities
    where crmwp.bd_erp_crm_customer_activities.`created_by` = 9
    order by id DESC

  •  2,572
    Aleksandar replied

    Hello 2wins

    Thank you for your purchase.

    Please be aware that the only support language is English. We do not speak Portuguese, so please translate your future responses.

    As per our documentation, using variables ( @ ), stored procedures and nested queries is not supported, but you can prepare a MySQL view (which will return the data you need); call it “view1” for example, and then build a wpDataTable based on a simple query like “SELECT * FROM view1”.

    Please note some this when working with the server-side processing feature:

    • Please do not use “LIMIT” in the SELECT statement. wpDataTables adds it automatically and it will be overridden.
    • Please do not use “ORDER BY” in the SELECT statement. wpDataTables has its own sorting engine so it makes no sense to use MySQL’s sorting, since it will be overridden. Also, server-side processing feature adds this part of statement automatically when users trigger the sorting on the front-end, and having it in initial statement may cause the table to crash.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables