/** * 防伪验证 * * @return Array */ private function fwCheck($fwCode) { $options = array('ecid' => $this->companyInfo['ecid'], 'api_user' => $this->companyInfo['mxt_api'], 'api_psw' => $this->companyInfo['mxt_psw'], 'OpenId' => $this->wechatMsg['FromUserName'], 'fwCode' => $fwCode, 'type' => 'wechat', 'isJewelryCheck' => $this->isJewelryCheckCompany()); $mxt = new MxtClient($options); $result = $mxt->FwCheck($fwCode); $fwParams = $mxt->getFwParams(); $addResponse = ''; if (!$mxt->getJewelryCheck() && $fwParams['CheckCount'] >= 0) { $activity = new \Weixin\Activity\ActivityResponse($this->companyInfo, $this->wechatMsg); if ($activity->hasActivity()) { if ($activity->hasFwLucky($fwParams)) { $addResponse = $activity->getResponse(); } if ($addResponse == '') { if ($activity->hasGeneralActivity()) { $addResponse = $activity->getResponse(); } } } } if ($addResponse) { $result['content'] = array_merge($result['content'], $addResponse); } //查询是否需要添加产品广告 return $result; }