예제 #1
0
 public function ajaxStartAsk($request, $response)
 {
     $patientId = $request->patientId;
     $spaceId = $request->spaceId;
     $type = $request->type;
     $openid = $request->openid;
     if(empty($openid))
     {
         return parent::DIRECT_OUTPUT;
     }
     $weixUser = DAL::get()->find_by_openid_and_weixintype('WeixUser', $openid, WeixUser::WEIXINTYPE_PATIENT);
     if($weixUser->isNull())
     {
         return parent::DIRECT_OUTPUT;
     }
     $weixMsgDto = new WeixMsgDto();
     $weixMsgDto->weixUserId = $weixUser->id;
     $weixMsgDto->event = 'wap';
     $weixMsgDto->fromUserName = $openid;
     $configs = WeixApi::getWeixConfigs(WeixUser::WEIXINTYPE_PATIENT);
     $ourOpenId = $configs['Openid'];
     $weixMsgDto->toUserName = $ourOpenId;
     if(false == empty($patientId))
     {
         $weixMsgDto->patientId = $patientId;
     }
     if(false == empty($spaceId))
     {
         $weixMsgDto->spaceId = $spaceId;
     }
     if(empty($type))
     {
         $type = "flow";//这里包括了补充报到和流交流
     }
     
     $this->noticeWeix($weixMsgDto, $type);
     return parent::DIRECT_OUTPUT;
 }
예제 #2
0
    private function getDealWrongMsg($openid, $weixDealingProposal)
    {/*{{{*/
        $proposalId = $weixDealingProposal->proposalId; 
        $proposal = DAL::get()->find("Proposal", $proposalId);
        $patient = $proposal->patient;
        $xiangyingTitle = "您还没有处理完" . $patient->userName . "的问题";
        
        $weixintype = WeixUser::WEIXINTYPE_SPACE;
        $config = WeixApi::getWeixConfigs($weixintype);
        $AppId = $config['AppId'];
        $domain = $config['domain'];
        $Url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' . $AppId . '&redirect_uri=' . $domain. '/wx/auth4space?proposalId=' .$proposal->id . '&response_type=code&scope=snsapi_base&state=#wechat_redirect';   

        $str = "■ 病情不适合由您处理请回复数字 2
■ 需离开处理其它紧急事项请回复数字 3 ";
        $arr = array
            (
                array(
                    'Title' => $xiangyingTitle,
                    'Description' => $str,
                    'PicUrl' => '',
                    'Url' => $Url,   
                ),
            );   
        return WeixApi::xiangyingNewsMsgWithArr($openid, WeixUser::WEIXINTYPE_SPACE, $arr);
    }/*}}}*/