|
@@ -177,16 +177,21 @@ class BookController extends BaseController
|
|
|
$brand = $request->header('x-nbrand', '');
|
|
|
$codeVersion = $request->header('x-codeversion', '');
|
|
|
$isAuth = check_qapp_auth($package ,0);
|
|
|
- $send_order_id = $request->header('send-order-id', 0);
|
|
|
// 根据包名、平台、版本号判断是否审核
|
|
|
if (Utils::checkIsAudit($package, $brand, $codeVersion) || $isAuth == false) {
|
|
|
$result = BookAuditService::getHomeBooksData($sex, $package,$isAuth);
|
|
|
return response()->success($result);
|
|
|
}
|
|
|
- if($send_order_id > 0 && $package == "com.beidao.kuaiying.yueai" && $sex == "male"){
|
|
|
- $result = BookAuditService::getYueaiHomeBooksData($sex, $package,$isAuth,1);
|
|
|
- return response()->success($result);
|
|
|
+ $user = (new QappUserService)->getGolableUser();
|
|
|
+ if($package == "com.beidao.kuaiying.yueai" && $sex == "male" && isset($user->uid) && !empty($user->uid) && $user->send_order_id > 0){
|
|
|
+
|
|
|
+ $orderRecord = ChapterOrderService::hasUserRecord($user->uid);
|
|
|
+ if($orderRecord){
|
|
|
+ $result = BookAuditService::getYueaiHomeBooksData($sex, $package,$isAuth,1);
|
|
|
+ return response()->success($result);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if ($sex == 'male') {
|
|
|
$channel = 1;
|
|
|
$reco_banner_type = ['MALE', 'PUBLIC'];
|
|
@@ -228,7 +233,7 @@ class BookController extends BaseController
|
|
|
}
|
|
|
|
|
|
\Log::info('un_send_order_book:package_id1:'.$package_id.' $package:'.$package);
|
|
|
- $user = (new QappUserService)->getGolableUser();
|
|
|
+
|
|
|
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);
|
|
@@ -602,16 +607,24 @@ class BookController extends BaseController
|
|
|
|
|
|
public function yueaiBackRecom(Request $request)
|
|
|
{
|
|
|
-
|
|
|
- $category_id = $request->input('category_id');
|
|
|
- $bid = $request->input('bid');
|
|
|
$package = $request->header('x-package', '');
|
|
|
if (empty($package) || $package != 'com.beidao.kuaiying.yueai') {
|
|
|
- return response()->error('PARAM_ERROR');
|
|
|
+ return response()->success([]);
|
|
|
}
|
|
|
- $bid = [58238,60534,63220,12587,63221,63548,14022,59334,58888,63417,61701];
|
|
|
- $bid = array_random($bid,4);
|
|
|
- $books = BookConfigService::getBooksByIds($bid,[],false);
|
|
|
+ $user = (new QappUserService)->getGolableUser();
|
|
|
+ if(isset($user->uid) && !empty($user->uid) && $user->send_order_id > 0){
|
|
|
+ $orderRecord = ChapterOrderService::hasUserRecord($user->uid);
|
|
|
+ if($orderRecord){
|
|
|
+ $bid = [58238,60534,63220,14500,13254,63221,63548,14022,59334,58888,63417,61701];
|
|
|
+ $bid = array_random($bid,4);
|
|
|
+ $books = BookConfigService::getBooksByIds($bid,[],false);
|
|
|
+ return response()->collection(new BookTransformer(), $books);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return response()->success([]);
|
|
|
+ $where = ['is_on_shelf' => [2]];
|
|
|
+ $where['channel_id'] = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
|
|
|
+ $books = BookConfigService::getBooks($where, [], 4);
|
|
|
return response()->collection(new BookTransformer(), $books);
|
|
|
}
|
|
|
|
|
@@ -624,9 +637,20 @@ class BookController extends BaseController
|
|
|
if (empty($package) || $package != 'com.beidao.kuaiying.yueai') {
|
|
|
return response()->success([]);
|
|
|
}
|
|
|
- $bid = [58238,60534,63220,12587,63221,63548,14022,59334,58888,63417,61701];
|
|
|
- $bid = array_random($bid,4);
|
|
|
- $books = BookConfigService::getBooksByIds($bid,[],false);
|
|
|
+ $user = (new QappUserService)->getGolableUser();
|
|
|
+ if(isset($user->uid) && !empty($user->uid) && $user->send_order_id > 0){
|
|
|
+ $orderRecord = ChapterOrderService::hasUserRecord($user->uid);
|
|
|
+ if($orderRecord){
|
|
|
+ $bid = [58238,60534,63220,14500,13254,63221,63548,14022,59334,58888,63417,61701];
|
|
|
+ $bid = array_random($bid,4);
|
|
|
+ $books = BookConfigService::getBooksByIds($bid,[],false);
|
|
|
+ return response()->collection(new BookTransformer(), $books);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return response()->success([]);
|
|
|
+ $where = ['is_on_shelf' => [2]];
|
|
|
+ $where['channel_id'] = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
|
|
|
+ $books = BookConfigService::getBooks($where, [], 4);
|
|
|
return response()->collection(new BookTransformer(), $books);
|
|
|
}
|
|
|
|