浏览代码

encode distributon id i

zz 6 年之前
父节点
当前提交
fdb02cd6d5
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 13 4
      app/Libs/Helpers.php

+ 13 - 4
app/Libs/Helpers.php

@@ -223,14 +223,19 @@ function ImageNewsToArray($datas){
  * 加密site id
  */
 function encodeDistributionChannelId($id){
-    $db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
+    $encrypt_pool = ['14'=>'xyvz5MEXLL52Mzn4','13'=>'laosiji','4372'=>'qhyeyue','365'=>'vciam5tg71'];
+    if(isset($encrypt_pool[$id])){
+        return $encrypt_pool[$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);
 }
@@ -239,14 +244,18 @@ function encodeDistributionChannelId($id){
  * 解密密site id
  */
 function decodeDistributionChannelId($code){
-    $db_encrypt_info = \DB::table('distribution_channel_id_encrypt')
+    $encrypt_pool = ['xyvz5MEXLL52Mzn4'=>'14','laosiji'=>'13','qhyeyue'=>'4372','vciam5tg71'=>'365'];
+    if(isset($encrypt_pool[$code])){
+        return $encrypt_pool[$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])){