我正在尝试使用jQuery DataTables AJAX ServerSide脚本......
我需要使用wp_users表加入wp_usermeta表...
如何使用示例服务器端处理脚本加入wp_usermeta表?该脚本可在https://datatables.net/examples/server_side/simple.html
找到相关代码是
$columns = array(
array( 'db' => 'user_login', 'dt' => 0 ),
array( 'db' => 'user_email', 'dt' => 1 ),
);
答案 0 :(得分: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();