public function valid() { $echoStr = $_GET["echostr"]; $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $tmpArr = array($this->token, $timestamp, $nonce); sort($tmpArr); $tmpStr = implode($tmpArr); $tmpStr = sha1($tmpStr); if ($tmpStr == $signature) { $custModel = new Model_Customer(); $data = array(); $data['id'] = $this->customer_id; $data['is_yz'] = 1; $custModel->upsert($data); return $echoStr; } }