PHP/THINKPHP创建优惠券码
来源:互联网 发布:java环境变量设置脚本 编辑:程序博客网 时间:2024/05/02 02:41
<?phpnamespace Addons\Coupon\Controller;use Home\Controller\AddonsController;class WapController extends AddonsController{ protected $model; public function __construct() { $GLOBALS ['is_wap'] = true; parent::__construct (); $uid= get_uid_by_openid(); $this->model = getModelByName ('coupon'); $this->model || $this->error ( 'model is not found!' ); } /* * Create coupon code * * @param $namespace string * @return $guid string * @author sun */ private function create_guid($namespace = '') { static $guid = ''; $uid = uniqid("", true); $data = $namespace; $data .= $_SERVER['REQUEST_TIME']; $data .= $_SERVER['HTTP_USER_AGENT']; $data .= $_SERVER['LOCAL_ADDR']; $data .= $_SERVER['LOCAL_PORT']; $data .= $_SERVER['REMOTE_ADDR']; $data .= $_SERVER['REMOTE_PORT']; $hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data))); // test str combination $guid = substr($hash, 0, 6) . '-' . substr($hash, 8, 4) . '-' . substr($hash, 12, 4) . '-' . substr($hash, 16, 4) . '-' . substr($hash, 20, 8); return $guid; }}// end
0 0
- PHP/THINKPHP创建优惠券码
- 优惠券码生成
- thinkPHP快速创建验证码
- Thinkphp.php
- 优惠券设计-获取随机码
- 【php:thinkphp】下获取验证码
- php使用thinkPHP验证码登录
- ThinkPHP的Model创建
- THINKPHP快速创建分页
- ThinkPHP创建web项目
- thinkphp创建项目1
- thinkphp创建临时表
- Zen Cart 设置产品优惠券、优惠码
- Godaddy 优惠券 优惠码 持续更新
- 电商优惠券,优惠码的生成
- thinkphp去掉index.php
- ThinkPHP取消index.php
- thinkphp去掉index.php
- 解决Spring MVC @ResponseBody返回中文字符串乱码问题
- CentOS系统启动流程及GRUB文件说明
- iOS所有常用证书,appID,Provisioning Profiles配置说明及制作图文教程
- 浑人和俗人
- Unity3D游戏开发称网游流行的第三人模式
- PHP/THINKPHP创建优惠券码
- 自动广播台配置攻略
- 发送json数据给服务器以及多值参数
- js中yyyy-mm-dd hh:mm 比较时间大小
- 基于mdrill的大数据分析
- solr-搜索-层面分析
- CentOS设置程序开机自启动的方法
- 常用的Java文件操作
- 如何写一个爆掉内存的PHP程序