|
@@ -143,8 +143,8 @@ class BookController extends BaseController
|
|
|
$price = $this->getPrice($book_info);
|
|
|
return $this->isBookNeedCharge($bid, $price);
|
|
|
default:
|
|
|
- $price = $last_chapter->is_vip ? $this->getPrice($book_info, $last_chapter->size) : 0;
|
|
|
- return $last_chapter->is_vip ? $this->isChapterNeedCharge($bid, $last_chapter->id, $price) : false;
|
|
|
+ $price = isset($last_chapter->is_vip) ? $this->getPrice($book_info, $last_chapter->size) : 0;
|
|
|
+ return isset($last_chapter->is_vip) ? $this->isChapterNeedCharge($bid, $last_chapter->id, $price) : false;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -222,11 +222,11 @@ class BookController extends BaseController
|
|
|
if(isset($user->uid) && !empty($user->uid)){
|
|
|
if(!$this->send_order_id || $this->send_order_id == 0 ){
|
|
|
\Log::info('un_send_order_book:uid:'.$this->uid.' $package:'.$package);
|
|
|
- $result = $this->getCheckBids($channel,$books,$package_id);
|
|
|
+ $result = $this->getCheckBids($channel,$books,$package_id,$package);
|
|
|
if(isset($result[1]['books']) && count((array)$result[1]['books']) > 1){
|
|
|
return response()->success($result);
|
|
|
}
|
|
|
- $result = $this->getCheckBids($channel,$books,0);
|
|
|
+ $result = $this->getCheckBids($channel,$books,0,$package);
|
|
|
return response()->success($result);
|
|
|
}else{
|
|
|
$package_id = 0;
|
|
@@ -236,7 +236,7 @@ class BookController extends BaseController
|
|
|
$package_id = 0;
|
|
|
}
|
|
|
\Log::info('un_send_order_book:package_id3:'.$package_id.' $package:'.$package);
|
|
|
- $result = $this->getCheckBids($channel,$books,$package_id);
|
|
|
+ $result = $this->getCheckBids($channel,$books,$package_id,$package);
|
|
|
return response()->success($result);
|
|
|
|
|
|
}
|
|
@@ -248,13 +248,14 @@ class BookController extends BaseController
|
|
|
* @param $package_id
|
|
|
* @return array
|
|
|
*/
|
|
|
- private function getCheckBids($channel,$books,$package_id)
|
|
|
+ private function getCheckBids($channel,$books,$package_id,$package)
|
|
|
{
|
|
|
$isAuthor = check_qapp_auth($package_id,1);
|
|
|
- $hotBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'hot',$package_id),$channel,$isAuthor);
|
|
|
- $liveBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'live',$package_id),$channel,$isAuthor);
|
|
|
- $recomBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'recom',$package_id),$channel,$isAuthor);
|
|
|
- $newBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'new_recom',$package_id),$channel,$isAuthor);
|
|
|
+ $hotBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'hot',$package_id),$channel,$package,$isAuthor);
|
|
|
+ $liveBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'live',$package_id),$channel,$package,$isAuthor);
|
|
|
+ $recomBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'recom',$package_id),$channel,$package,$isAuthor);
|
|
|
+ $newBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'new_recom',$package_id),$channel,$package,$isAuthor);
|
|
|
+
|
|
|
|
|
|
return array_filter([
|
|
|
['type' => 'reco_banner', 'lable' => '首页banner', 'books' => $books],
|
|
@@ -270,11 +271,16 @@ class BookController extends BaseController
|
|
|
* 检测并补充不满足条件的书籍id
|
|
|
* @param $bid_list
|
|
|
* @param $channel : 频道
|
|
|
+ * @param $package : 频道
|
|
|
* @return array
|
|
|
*/
|
|
|
- private function getCheckBooks($bid_list,$channel,$is_author)
|
|
|
- {
|
|
|
|
|
|
+ private function getCheckBooks($bid_list,$channel,$package,$is_author)
|
|
|
+ {
|
|
|
+ $hidden_cp = getHiddenCp();
|
|
|
+ if($package !== 'com.beidao.kuaiying.zsy'){
|
|
|
+ $hidden_cp = array_merge($hidden_cp,['lianshang']);
|
|
|
+ }
|
|
|
//获取书本数量
|
|
|
$count = count($bid_list);
|
|
|
if (!$is_author){
|
|
@@ -293,8 +299,9 @@ class BookController extends BaseController
|
|
|
->whereIn('book_configs.bid',$bid_list)
|
|
|
->where('book_configs.is_on_shelf',2)
|
|
|
->where('book_configs.charge_type','!=','BOOK')
|
|
|
- ->whereNotIn('book_configs.cp_source',getHiddenCp())
|
|
|
+ ->whereNotIn('book_configs.cp_source',$hidden_cp)
|
|
|
->where($where)
|
|
|
+
|
|
|
->where('book_categories.pid',$channel)
|
|
|
->count();
|
|
|
|
|
@@ -312,7 +319,7 @@ class BookController extends BaseController
|
|
|
->whereIn('book_configs.bid',$bid_list)
|
|
|
->where('book_configs.is_on_shelf',2)
|
|
|
->where($where)
|
|
|
- ->whereNotIn('book_configs.cp_source',getHiddenCp())
|
|
|
+ ->whereNotIn('book_configs.cp_source',$hidden_cp)
|
|
|
->where('book_categories.pid',$channel)
|
|
|
->pluck('book_configs.bid')->all();
|
|
|
$bid_list = array_intersect($bid_list,$bids);
|
|
@@ -323,7 +330,8 @@ class BookController extends BaseController
|
|
|
->where('book_configs.is_on_shelf',2)
|
|
|
// ->where('book_configs.charge_type','!=','BOOK')
|
|
|
->where($where)
|
|
|
- ->whereNotIn('book_configs.cp_source',getHiddenCp())
|
|
|
+ ->whereNotIn('book_configs.cp_source',$hidden_cp)
|
|
|
+
|
|
|
->where('book_categories.pid',$channel)
|
|
|
->inRandomOrder()
|
|
|
->limit($supplement_count)
|
|
@@ -412,6 +420,7 @@ class BookController extends BaseController
|
|
|
}
|
|
|
|
|
|
$page_size = $request->input('page_size', 15);
|
|
|
+ $where['channel_id'] = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
|
|
|
$books = BookConfigService::getBooks($where, $order, $page_size);
|
|
|
return response()->pagination(new BookTransformer, $books);
|
|
|
}
|
|
@@ -427,15 +436,20 @@ class BookController extends BaseController
|
|
|
$package = $request->header('x-package', '');
|
|
|
$category_id = $request->input('category_id');
|
|
|
$bid = $request->input('bid');
|
|
|
+ $package = $request->header('x-package', '');
|
|
|
if (empty($bid) || (empty($category_id) && $category_id != 0)) {
|
|
|
return response()->error('PARAM_ERROR');
|
|
|
}
|
|
|
$isAuth = check_qapp_auth($package ,0);
|
|
|
$bid = BookService::decodeBidStatic($bid);
|
|
|
$where = ['category_id' => $category_id, 'is_on_shelf' => [2]];
|
|
|
+
|
|
|
if (!$isAuth){
|
|
|
$where['cp_source'] = "ycsd";
|
|
|
}
|
|
|
+
|
|
|
+ $where['channel_id'] = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
|
|
|
+
|
|
|
$books = BookConfigService::getBooks($where, [], 4);
|
|
|
$data = [];
|
|
|
foreach ($books as $v) {
|
|
@@ -516,6 +530,7 @@ class BookController extends BaseController
|
|
|
$bids = [159, 2439, 6276, 10074, 5409, 9379, 10323, 9078, 3603, 487];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$isAuth = check_qapp_auth($package,0);
|
|
|
if (!$isAuth){
|
|
|
$rank = config('home.rank');
|
|
@@ -524,7 +539,10 @@ class BookController extends BaseController
|
|
|
$bids = $rank['female'];;
|
|
|
}
|
|
|
}
|
|
|
- $books = collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($bids));
|
|
|
+
|
|
|
+ $channel_id = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
|
|
|
+ $books = collectionTransform(new BookTransformer, BookConfigService::getBookLists(compact('bids','channel_id')));
|
|
|
+
|
|
|
return response()->success($books);
|
|
|
}
|
|
|
|