|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace App\Http\Controllers\WapBrowser\Index;
|
|
|
|
|
|
+use App\Modules\RecommendBook\Services\RecommendService;
|
|
|
use Illuminate\Http\Request;
|
|
|
use App\Modules\Book\Services\BookConfigService;
|
|
|
use App\Http\Controllers\Wap\Book\Transformers\BookTransformer;
|
|
@@ -21,29 +22,36 @@ class IndexController extends BaseController
|
|
|
[
|
|
|
'label' => '轮播',
|
|
|
'key' => 'LOOP',
|
|
|
+ 'hash'=>'loop'
|
|
|
],
|
|
|
[
|
|
|
'label' => '热书推荐',
|
|
|
'key' => 'HOT',
|
|
|
+ 'hash'=>'hot'
|
|
|
],
|
|
|
[
|
|
|
'label' => '神书推荐',
|
|
|
'key' => 'ZHIBO',
|
|
|
+ 'hash'=>'live'
|
|
|
],
|
|
|
[
|
|
|
'label' => '编辑推荐',
|
|
|
'key' => 'RECOM',
|
|
|
+ 'hash'=>'recom'
|
|
|
],
|
|
|
[
|
|
|
'label' => '新书推荐',
|
|
|
'key' => 'NEW_RECOM',
|
|
|
+ 'hash'=>'new_recom'
|
|
|
],
|
|
|
];
|
|
|
$SEX = $sex = $request->has('type') && $request->input('type') == 'male' ? 'MALE' : 'FEMALE';
|
|
|
|
|
|
//$SEX = $sex === 'male' ? "MALE" : "FEMALE";
|
|
|
+ $channel = $SEX =='MALE'?1:2;
|
|
|
foreach ($subjects as &$subject) {
|
|
|
- $subject['list'] = BookConfigService::getBooksByIds(explode(',', env("BOOK_{$SEX}_{$subject['key']}")));
|
|
|
+ //$subject['list'] = BookConfigService::getBooksByIds(explode(',', env("BOOK_{$SEX}_{$subject['key']}")));
|
|
|
+ $subject['list'] = BookConfigService::getBooksByIds(RecommendService::getRecommendBooksIds($channel,$subject['hash']));
|
|
|
}
|
|
|
|
|
|
$ranks = [
|