'ok', # 小于0为失败 0 => '暂时未处理', -1 => 'appid为空', -2 => '产品错误', -3 => 'appid无效', -4 => '余额不足或者没有传入价格', -5 => 'signature不能为空', -6 => 'nonce不能为空', -7 => 'time不能为空', -8 => 'signature已失效', -9 => 'signature验证失败', -100 => '请求错误', -101 => '订单不存在', -102 => '订单号重复', 1100 => '商品不存在', 401 => '签名错误', 408 => '时间戳过期', -103 => '正在处理中', -104 => '锁卡失败', -1000 => '系统维护中', ); public function initialize() { parent::initialize(); $this->sign_type = sysconf('sign_type'); if ($this->check) { // $this->check(); } } # 获取输入的信息 # 检测开放或者维护时间 protected function checkOpenTime($opentime) { if ($opentime && strstr($opentime, ':')) { $opentime = str_replace(':', '', $opentime); if (strstr($opentime, '-')) { $value = explode('-', $opentime); $cur = intval(date('Hi')); $value[0] = intval($value[0]); $value[1] = intval($value[1]); if ($value[1] < $value[0]) { if ($cur >= $value[0] || $cur < $value[1]) { $this->no(-1000); } } else { if ($cur >= $value[0] && $cur < $value[1]) { $this->no(-1000); } } } } } /** * 对输入的信息进行加密 */ }