leftjoin('book_categories', 'books.category_id', 'book_categories.id') ->select('book_configs.bid', 'book_configs.cover', 'book_configs.book_name', 'books.chapter_count','books.last_chapter','book_categories.channel_name') ->whereIn('book_configs.bid', $bid) ->get(); } public static function getBookSimpleInfoByBidAndFields($bid,$field){ return BookConfig::join('books', 'book_configs.bid', '=', 'books.id') ->leftjoin('book_categories', 'books.category_id', 'book_categories.id') ->select($field) ->where('book_configs.bid', $bid) ->first(); } /** * * 根据条件获取图书 * @param array $where ['key'=>'根据关键词查询','category_id'=>'根据分类id查询','is_on_shelf'=>上下架查询,'channel_name'=>'频道查询(男频女频)'] * @param array $order 排序 默认是bid排序 * @param int $page_size * @return mixed */ public static function getBooks(array $where, array $order = [], $page_size = 15) { return BookConfig::getBooks($where, $order, $page_size); } }