mrakodol / Laravel-5-Bootstrap-3-Starter-Site

Laravel Framework 5 Bootstrap 3 Starter Site is a basic application with news, photo and video galeries.
884 stars 406 forks source link

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category' in 'where clause' #190

Closed sandeepv closed 8 years ago

sandeepv commented 8 years ago

@davidpiesse | @phpclub | @frankperez87 | @jarnix My Data Control

public function data() { $article = Article::join('languages', 'languages.id', '=', 'articles.language_id') ->join('article_categories', 'article_categories.id', '=', 'articles.article_category_id') ->select(array('articles.id','articles.title','article_categories.title as category', 'languages.name', 'articles.created_at'));

return Datatables::of($article)
    ->add_column('actions', '<a href="{{{ URL::to(\'admin/article/\' . $id . \'/edit\' ) }}}" class="btn btn-success btn-sm iframe" ><span class="glyphicon glyphicon-pencil"></span>  {{ trans("admin/modal.edit") }}</a>
            <a href="{{{ URL::to(\'admin/article/\' . $id . \'/delete\' ) }}}" class="btn btn-sm btn-danger iframe"><span class="glyphicon glyphicon-trash"></span> {{ trans("admin/modal.delete") }}</a>
            <input type="hidden" name="row" value="{{$id}}" id="row">')
    ->remove_column('id')

    ->make();

}

When use search box

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category' in 'where clause' (SQL: select count(*) as aggregate from (select '1' as row_count from articles inner join languages on languages.id = articles.language_id inner join article_categories on article_categories.id = articles.article_category_id where articles.deleted_at is null and (LOWER(articles.id) LIKE %k% or LOWER(articles.title) LIKE %k% or LOWER(category) LIKE %k% or LOWER(languages.name) LIKE %k% or LOWER(articles.created_at) LIKE %k%)) count_row_table)

Please help me to fix this.

physio commented 8 years ago

i have the same problem

stojankukrika commented 8 years ago

now it will be solved. get new version.