文档章节

xs_run加密还原

hnphper
 hnphper
发布于 2017/05/03 12:01
字数 1052
阅读 23
收藏 0

示例

xs_run('yTfFh3hs+gMq3Gvqe+1CplaQFAUkEDoQkGg5HYB8f+jZ0I68e1MKOaGsiR2PzQ9/LcqPLDg1LhqDEYnAERaoamKTynvVXCv30TH8J4m1JxOIe4WuWW05hky218XhW8h95AsWI73O3dVwSgcqLt5414fGgYwgp3g1pp01Vo0oMaQ7yY437ItNyqrmMvOaWrDPkpC49JCPB8edqwi4geJGo93dCf7988GPBMO8ECwgrmtME4PKJ9H/lI+DK8dgjTQBuGq8OSvhwiE9yTUsunbhyYoXe4k6y/gGxlmDR+OPpGOqsc51X496EDRCwnX5Lb/twCaWe/vFL7q1ER5ekTZ1p7/3kTH/ycodHSQPkhUcLnO3iD2dJCmMbYEV0T5NeCJQpCv1L7RBJGhfExUIjfOZO7K8uinKsGg4yYJuvB5cvBkaJ+RQyCvVSTJUa+oCpDUUpSn80GQqexRfLDmFj6UCj+zWui5UXYmPXQxGXGxeyB9uyYRv0TZWL+Zoc7q60j2Sffk5hSMuJCktwfkAofXBoPUVzce5WPVsO2AAQVKQ3jujyL3gpd9tXAkralpQmYvVuAJvp+ompDZ/jTEAkfQgXz6VKfocjhQ7wiQ4OSNCv4RfwRKPjAHhe4pOjcntEDkCeSm/Yf960jNVaSk1Z456JGK/JYoJ3GJGGFXVzcekWywUOry0ULqQ3s7lyjuSvGUMnfmPE4bQEApVJ4JQe+o3vSW3uBQ7yYgKucp9y7pIeg/DL76PjdJ9XYxCeBzGXGbUyzOpw+K8vn9W0YZozfk8ECgZKQIr0TM4JQH/lAMheCRBu+RMs4Mmaf5hyUX9yAUJ0SMdadIJkGats6QOLTa1pqZBaGaoXThFyiRgEDly3to5Lb/t3Sqieg/NLqK1P+XUYdxVpdoGWGcMe4VgwemDvwQxeySGv7q2l721liOByY2djdH4T4kPLA5Ajn5MwHNrO+RA0G63jTgOsBN7m+IKEAM2LDz4pcbQeUIVyTpspRKVX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QyBqDETzdeHNnwGRPjhgApDJ5afHQLlIVpdouJU5Fe493b4aDfSWZeTx4NF8SMFu5HNm1MOE6IdlZMY1QVdJMBeIVL4pm5n4oO7CMskJpyMy6yyD2kZz3eCndJ+gQL7zVjYMyEGo1afIopS2hRC98ulOFsDOIyRgdeC5BOTJ0XYxVpdoGidnDe4o7w+ODv+kiEQn/Yf98EC6VYfk1wT5yJGK/JzEBLdJGji5VL4pmOmghO7QosfmpyGNFyYockdo+v4Jdp+RQXAEVJTJUTd9PJDUUvCzFsAZSLb22s+5VLDxvsd93adX2cGpZSGm6JAUMJig0jdH6OSR684xNB5AdAMt3Z8TB6Vw8GL845stvJtwg1PG+8SFAWreI52LHPLtR3s74I97k2vk2LDzsB6PYeGu5pPE/pp+GX3tqk7bppfQILRQtwBaWsxUdbfq3jYXUcGpMyQO4pARUJDo0HD6dLSR2sYZ5bSADr0OSccUPreZUeT7qe4kG8nQQtLyG6VYzMj1AhfYcU2Fw70iOreFw7eue1jc/W54V8sGFWVVsuy7r28L/EDK7yYg5LbB2y7eZePKDL2J1kR5ekToMyQOAcTKgeB94HAbdLSOFkfU9lYptJGKtzfzWRB2qpSpPeYogy4v8ac6Bn7QlLSz8TGKhjT2ueBo4xdHvEA5Wj7x4pcbQ0GvVp4p/p+9VpDUUObqLXUv5umx9yAkFsHZ6LhXIkcO6XYm2JnxGXGbULhOGw+K8vfOWjYZocBNFwGM1k7zBwfmUe7pAsnmGp46qaYOGuBRQJAqGwlq8jYg70Bo8sCkRkAh1eCnjJA/7pBq1sdOdemxBaCQjMV4Z8aFDaI6Pt8zIURCpABQgcYN8XYxVpdoGXGbUegOGaYKavnqWeYZoYf9HSAa7YnW1X6b6+76NldoBKhU=');

还原代码

<?php
/**
 * 扣费模型
 */
class AdPayModel
{
    /**
     * 每日广告数据统计
     * 进行每日扣款
     * 更新地区行业投放数据
     */
    public function advertPay($t, $t1)
    {
        $map_ad_pay['w_time'] = array(array('egt', $t), array('lt', $t1));
        $map_ad_pay['pay'] = array('egt', 0);
        $map_ad_pay['status'] = 0;//未进行扣费的
        $ad_pays = M('w_ad_pay')->where($map_ad_pay)->select();
        
        //更新广告数据
        foreach ($ad_pays as $item)
        {
            M()->startTrans();
            $ad = M('w_ad')->find($item['ad_id']);
            //扣款步骤
            if($item['ad_id']&&$ad&&!$item['status'])
            {
                $data = null;
                $data['day_views'] = $ad['day_views']-$item['views'];//累计每日浏览量-昨日累计浏览=今日浏览
                $data['total_views'] = array('exp','total_views+'.$item['views']);
                $day_pay = $item['pay'];//今日扣款总额
                $remark='[广告每日结算]:['.$ad['id'].']'.date('Y-m-d', $t);
                if($ad['is_admin']!='1')
                {
                    $data['total_v_pay'] = array('exp','total_v_pay+'.$item['pay']);
                    $data['day_v_pay'] = $ad['day_v_pay']-$item['pay'];//累计每日浏览量-昨日累计浏览=今日浏览
                    //检查广告商账户预付款
                    $ad_user = M('User')->where(array('id'=>$ad['user_id']))->find();
                    $result['status'] = true;
                    //先扣赠送款
                    if($item['free_money']>0)
                    {
                        $rs = lockChangeAccountRemain(-$item['free_money'], 'free_money', 11, $remark.'[赠送款]', $ad_user['username'], 'w_ad_pay', $item['id']);
                        $result['status'] = $result['status']&& $rs['status'];
                    }
                    //预付款
                    if($item['imprest']>0)
                    {
                        $rs = lockChangeAccountRemain(-$item['imprest'], 'imprest', 11, $remark.'[预付款]', $ad_user['username'], 'w_ad_pay', $item['id']);
                        $result['status'] = $result['status']&& $rs['status'];
                    }
                    //广告费
                    if($item['ad_money']>0)
                    {
                        $rs = lockChangeAccountRemain(-$item['ad_money'], 'ad_money', 11, $remark.'[广告费]', $ad_user['username'], 'w_ad_pay', $item['id']);
                        $result['status'] = $result['status']&& $rs['status'];
                    }
                    if(!$result['status'])//账户余额不足,设置预存款时不会执行该方法
                    {
                        $data['use'] = 0;//扣费失败广告下架
                    }
                    else//扣款成功
                    {
                        /**
                         * 更新已入账奖金
                         */
                        $rs = M('w_ad_pay')->where(array('id'=>$item['id']))->save(array('status'=>1));
                        if($rs!==false)
                        {
                            $map_b['w_time'] = array(array('egt', $t), array('lt', $t1));
                            $bonus_cmp = M('w_bonus_company')->lock(true)->where($map_b)->find();
                            if($bonus_cmp)
                            {
                                $bonus_cmp['pay_imprest'] = $bonus_cmp['pay_imprest']>0?$bonus_cmp['pay_imprest']+$item['imprest']:$item['imprest'];
                                $bonus_cmp['pay_ad_money'] = $bonus_cmp['pay_ad_money']>0?$bonus_cmp['pay_ad_money']+$item['ad_money']:$item['ad_money'];
                                $day_true_pay = (1-$this->city_income*(1+$this->borker_area_income)-$this->county_income*(1+$this->borker_area_income))*$item['imprest']+$item['ad_money'];//真实钱币获得 70%预付款+广告费
                                $bonus_cmp['pay_money'] = $bonus_cmp['pay_money']>0?$bonus_cmp['pay_money']+$day_true_pay:$day_true_pay;
                                $rs = M('w_bonus_company')->save($bonus_cmp);//奖金纪录

                            }
                            else
                            {
                                $day_true_pay = (1-$this->city_income*(1+$this->borker_area_income)-$this->county_income*(1+$this->borker_area_income))*$item['imprest']+$item['ad_money'];//真实钱币获得 70%预付款+广告费
                                if($day_true_pay>0)
                                {
                                    $bonus_cmp['pay_imprest'] = $item['imprest'];
                                    $bonus_cmp['pay_ad_money'] = $item['ad_money'];
                                    $bonus_cmp['pay_money'] = $day_true_pay;
                                    $rs = M('w_bonus_company')->add($bonus_cmp);//奖金纪录
                                }

                            }
                            if($rs===false)
                            {
                                M()->rollback();
                                throw_exception('公司广告统计记录写入失败!'.M()->_sql());
                            }
                        }
                        else
                        {
                            M()->rollback();
                            throw_exception('公司广告统计记录写入失败!'.M()->_sql());
                        }
                    }
                }
                $rs = M('wAd')->where('id='.$ad['id'])->save($data);//广告更新
                if($rs===false)
                {
                    M()->rollback();
                    throw_exception('广告记录更新失败!'.M()->_sql());
                }
            }
            M()->commit();
        }
        //更新地区行业数据
        $ad_pay_areas = M('w_ad_pay_area')->where($map_ad_pay)->select();
        foreach ($ad_pay_areas as $item)
        {
            $map['ad_id'] = $item['ad_id'];
            $map['throw_area'] = $item['throw_area'];
            $ad_throw_area = M('w_ad_throw_area')->where($map)->find();

            //更新地区行业数据
            if($ad_throw_area&&!$ad_throw_area['status'])
            {
                $data = null;
                $data['day_views'] = $ad['day_views']-$item['views'];//累计每日浏览量-昨日累计浏览=今日浏览
                $data['day_pay'] = $ad['day_pay']-$item['pay'];//累计每日浏览量-昨日累计浏览=今日浏览
                $data['totay_pay'] = array('exp','totay_pay+'.$item['pay']);
                $data['status'] = '1';
                M('w_ad_throw_area')->where(array('id'=>$ad_throw_area['id']))->save($data);//广告更新
            }
        }
    }

}
?>

更多详细请关注QQ群 233415606

© 著作权归作者所有

共有 人打赏支持
hnphper

hnphper

粉丝 0
博文 6
码字总数 2346
作品 2
卢湾
程序员
私信 提问
开发者回应 iPhone XS 美颜:没内置滤镜、算法可改进

今年 iPhone Xs 系列发布后,立刻成为网友们讨论的最热电子产品,不仅因为它是目前世界上最出色的手机,而且它昂贵的价格,iOS 12 息屏充电的 BUG 和前置摄像头的“美颜”效果,都是网友们的...

局长
2018/10/03
205
1
仿 iOS 11 苹果商店 - ASList

概览: swift4语言模仿iOS11苹果商店基本框架页面。 特性 swift4语法,搭建页面基本结构,适合初学者学习 轻量级设计,项目结构目录清晰,让你所见即所得 适配iPhoneX、XS、XR、XSMax 功能 ...

LY_MD
02/15
0
0
MSSQL-最佳实践-数据库备份加密

title: MSSQL-最佳实践-数据库备份加密 author: 风移 摘要 在SQL Server安全系列专题月报分享中,我们已经分享了:如何使用对称密钥实现SQL Server列加密技术、使用非对称密钥实现SQL Serve...

风移
03/26
0
0
Unity3D教程宝典之两步实现超实用的XML存档【引文】

使用方法非常简单: 把GameDataManager和XmlSaver两个脚本添加至工程后 (1)新建一个GameObject,起名GameDataManager并将GameDataManager脚本拖到上面。 (2)在GameDataManager里的GameData类中...

陌路-野山君
2016/02/18
62
0
使用Handy Backup 6.2进行数据备份步骤(评软件优缺点)

概括说一下,Handy Backup是一款功能强大的备份软件,支持自动备份到:CD-RW/DVD,硬盘或网络驱动器,ZIP、JAZ、MO和 FTP、LAN服务器,支持备份压缩(ZIP),支持备份加密(BLOWFISH 128位加密)...

宋国建
2018/06/12
0
0

没有更多内容

加载失败,请刷新页面

加载更多

腾讯面试:一条SQL语句执行得很慢的原因有哪些?

说实话,这个问题可以涉及到 MySQL 的很多核心知识,可以扯出一大堆,就像要考你计算机网络的知识时,问你“输入URL回车之后,究竟发生了什么”一样,看看你能说出多少了。 之前腾讯面试的实...

java菜分享
10分钟前
0
0
Java 基本功 之 CAS

本文首发于个人公众号《andyqian》, 期待你的关注! 前言 在Java并发编程中,我们经常使用锁对竞争资源予以并发控制,以解决资源竞争的问题。但无论是使用 Lock 还是 Synchronized,随着锁机...

andyqian
14分钟前
2
0
信号量与条件变量的区别

注意信号量与条件变量的区别 信号量内容可见:http://www.cnblogs.com/charlesblc/p/6142868.html 信号量、共享内存,以及消息队列等System V IPC三剑客主要关注进程间通信; 而条件变量、互...

shzwork
25分钟前
0
0
在VirtualBox 6.0中安装fedora 30

操作系统安装完毕后首先进行更新。 sudo dnf update 重启虚拟机后,安装VirtualBox依赖的软件包。 sudo dnf install kernel-headers kernel-devel dkms gcc 最后,安装“增强功能”。...

gugudu
33分钟前
0
0
861. Score After Flipping Matrix

为了获得最大值,我们必须保证每一行列下标小的1尽可能的多(最高位的1尽可能多)。 首先,考虑我们可以进行的操作有 翻转列,进行列操作 翻转行,进行行操作 通过行操作 我们总是可以使得第...

reter
34分钟前
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部