瀏覽代碼

Merge branch 'master' of iqiyoo:zhuishuyun_wap into stabble

onlinetest 6 年之前
父節點
當前提交
3a264a87cb
共有 2 個文件被更改,包括 17 次插入1 次删除
  1. 1 1
      app/Http/Controllers/Wap/Book/ChapterController.php
  2. 16 0
      app/Libs/Helpers.php

+ 1 - 1
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -1252,7 +1252,7 @@ class ChapterController extends BaseController
     private function isVisitDomainEqualBookDomain($domain)
     {
         $book_domain = $this->book_info->promotion_domain;
-        if(in_array($this->distribution_channel_id,[365])){
+        if(in_array($this->distribution_channel_id,[365,4372])){
             $book_domain = 'zhuishuyun.com';
         }
         if ($domain == 'zhuishuyun' && stripos($book_domain, 'leyuee') !== false) {

+ 16 - 0
app/Libs/Helpers.php

@@ -223,6 +223,14 @@ function ImageNewsToArray($datas){
  * 加密site id
  */
 function encodeDistributionChannelId($id){
+    $db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
+        ->where('distribution_channel_id',$id)
+        ->where('is_enable',1)
+        ->select('en_distribution_channel_id')
+        ->first();
+    if($db_encrypt_info && $db_encrypt_info->en_distribution_channel_id){
+        return $db_encrypt_info->en_distribution_channel_id;
+    }
     $hashids = new \Hashids\Hashids('',16,'abcdefghjklmnopqrstuvwxyz1234567890');
     return $hashids->encode($id);
 }
@@ -231,6 +239,14 @@ function encodeDistributionChannelId($id){
  * 解密密site id
  */
 function decodeDistributionChannelId($code){
+    $db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
+        ->where('en_distribution_channel_id',$code)
+        ->where('is_enable',1)
+        ->select('distribution_channel_id')
+        ->first();
+    if($db_encrypt_info && $db_encrypt_info->distribution_channel_id){
+        return $db_encrypt_info->distribution_channel_id;
+    }
     $hashids = new \Hashids\Hashids('',16,'abcdefghjklmnopqrstuvwxyz1234567890');
     $res = $hashids->decode($code);
     if($res && isset($res[0])){