|
@@ -315,7 +315,7 @@ class BookConfig extends Model
|
|
|
* @param array $order
|
|
|
* @return mixed
|
|
|
*/
|
|
|
- public static function getBooksByIds(array $bid_arr, array $order = [])
|
|
|
+ public static function getBooksByIds(array $bid_arr, array $order = [], $is_external_shelf = true)
|
|
|
{
|
|
|
$res = self::join('books', 'book_configs.bid', '=', 'books.id')
|
|
|
->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
|
|
@@ -355,8 +355,10 @@ class BookConfig extends Model
|
|
|
'books.name as old_name',
|
|
|
'book_configs.recommend_cid'
|
|
|
)
|
|
|
- ->whereIn('book_configs.bid', $bid_arr)
|
|
|
- ->where('is_on_shelf', 2);
|
|
|
+ ->whereIn('book_configs.bid', $bid_arr);
|
|
|
+
|
|
|
+ if($is_external_shelf) $res->where('is_on_shelf',2);// 默认外部上架
|
|
|
+
|
|
|
if ($order) {
|
|
|
$res->orderBy($order[0], $order[1]);
|
|
|
} else {
|