private function getEmployeeResponse($employeeName)
 {
     $employee = new \Weixin\Employee\EmployeeResponse($this->companyInfo, $this->wechatMsg);
     $response['type'] = 'news';
     $response['content'] = $employee->getResponseWithName($employeeName);
     return $response;
 }
示例#2
0
 private function qrSceneEvent($bSubItem)
 {
     //保存扫描事件
     $this->saveScanLog();
     $scene = explode('_', $this->wechatMsg['EventKey']);
     if (count($scene) > 1) {
         $sceneId = $scene[1];
     } else {
         $sceneId = $scene[0];
     }
     $addResponse = '';
     if ($sceneId > 100000) {
         $addResponse = array(array('Title' => "欢迎使用微信登录Alexander's官网", 'PicUrl' => "http://www.icalex.com/Public/images/2.jpg", 'Url' => "http://www.icalex.com/Mobile/Index/wechatLogin/sense/{$sceneId}/openid/{$this->wechatMsg['FromUserName']}", 'Description' => '请点击《阅读全文》完成登录操作。'));
     } else {
         $m = M('Company_qr_type');
         $opt = array('ecid' => $this->companyInfo['ecid'], 'scene_id' => $sceneId);
         $result = $m->where($opt)->find();
         if ($result) {
             switch ($result['type']) {
                 case 'activity':
                     $activity = new \Weixin\Activity\ActivityResponse($this->companyInfo, $this->wechatMsg);
                     $activity->responseScan($result['activityId'], $bSubItem);
                     $addResponse = $activity->getResponse();
                     break;
                 case 'fwLabel':
                     $label = new \Weixin\Label\LabelResponse($this->companyInfo, $this->wechatMsg);
                     $addResponse = $label->getResponse($result['labelId']);
                     break;
                 case 'product':
                     $product = new \Weixin\Product\ProductResponse($this->companyInfo, $this->wechatMsg);
                     $addResponse = $product->getResponse($result['productId'], 'all');
                     break;
                 case 'employees':
                     $employee = new \Weixin\Employee\EmployeeResponse($this->companyInfo, $this->wechatMsg);
                     $addResponse = $employee->getResponseWithId($result['employeeId']);
                     break;
                 case 'dealer':
                     $dealer = new \Weixin\Dealer\DealerResponse($this->companyInfo, $this->wechatMsg);
                     $addResponse = $dealer->getResponseWithId($result['dealerId'], 'all');
                     break;
             }
         }
     }
     if ($addResponse) {
         return $addResponse;
     }
 }