|
@@ -121,4 +121,26 @@ class CommonHelper
|
|
|
if (!$site) return false;
|
|
|
return in_array($distribution_channel_id, explode(',', $site));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 加密site id
|
|
|
+ */
|
|
|
+ function encodeDistributionChannelId($id)
|
|
|
+ {
|
|
|
+ $encrypt_pool = ['14' => 'xyvz5mexll52mzn4', '13' => 'laosiji', '4372' => 'qhyeyue', '365' => 'vciam5tg71', '384' => 'sdxisd', '5795' => 'gyp23fzu', '191' => 'jinsshxs'];
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|