Exemplo n.º 1
0
 /**
  * @param       $columns
  * @param       $start
  * @param       $length
  * @param       $search_string
  * @param       $order_column
  * @param       $order_dir
  * @param array $where_spe
  * @return array
  */
 public function findDataTableBlog($columns, $start, $length, $search_string, $order_column, $order_dir, $where_spe = array())
 {
     foreach ($columns as &$col) {
         if (!empty($col['name']) && $col['name'] == 'nbcomment') {
             $col['spe'] = true;
             $col['count_one_to_many'] = true;
             $col['name'] = 'blogcomments';
         }
     }
     $where_spe = array();
     return parent::findDataTable($columns, $start, $length, $search_string, $order_column, $order_dir, $where_spe);
 }
 public function findDataTableBlogComment($columns, $start, $length, $search_string, $order_column, $order_dir, $blog_id)
 {
     foreach ($columns as &$col) {
         if (!empty($col['name']) && $col['name'] == 'usefull') {
             $col['spe'] = true;
             $col['group_concat_one_to_many'] = true;
             $col['table'] = 'commentusefull';
             $col['field'] = 'isusefull';
         }
     }
     $where_spe = array();
     $where_spe[] = 'd.blog = ' . $blog_id;
     return parent::findDataTable($columns, $start, $length, $search_string, $order_column, $order_dir, $where_spe);
 }