简体   繁体   中英

jQuery DataTables ServerSide Processing Script Join Table

I am attempting to use jQuery DataTables AJAX ServerSide script...

I need to join the wp_usermeta table with the wp_users table...

How do I join the wp_usermeta table using the example server-side processing script? The script can be found at https://datatables.net/examples/server_side/simple.html

The relevant code is

$columns = array(
    array( 'db' => 'user_login', 'dt' => 0 ),
    array( 'db' => 'user_email', 'dt' => 1 ),
);
$this->datatables->select('um.*,u.*')
        ->from('wp_usermeta as um')
        ->join('wp_users as u','um.user_id=u.user_id')
        ->add_column('View','$1','<a href="example.php?id=$1" class="btn btn-warning view">View</button>')

echo $this->datatables->generate();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM