|
@@ -223,6 +223,14 @@ function ImageNewsToArray($datas){
|
|
* 加密site id
|
|
* 加密site id
|
|
*/
|
|
*/
|
|
function encodeDistributionChannelId($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');
|
|
$hashids = new \Hashids\Hashids('',16,'abcdefghjklmnopqrstuvwxyz1234567890');
|
|
return $hashids->encode($id);
|
|
return $hashids->encode($id);
|
|
}
|
|
}
|
|
@@ -231,6 +239,14 @@ function encodeDistributionChannelId($id){
|
|
* 解密密site id
|
|
* 解密密site id
|
|
*/
|
|
*/
|
|
function decodeDistributionChannelId($code){
|
|
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');
|
|
$hashids = new \Hashids\Hashids('',16,'abcdefghjklmnopqrstuvwxyz1234567890');
|
|
$res = $hashids->decode($code);
|
|
$res = $hashids->decode($code);
|
|
if($res && isset($res[0])){
|
|
if($res && isset($res[0])){
|