示例#1
0
文件: msg.php 项目: zxw5775/yuhunclub
 private function do_the_staff_reply($xml)
 {
     if (!$this->bind_check($xml)) {
         return;
     }
     $text = trim('' . $xml->Content);
     if (!in_array($text, self::$the_staff_keywords)) {
         return;
     }
     $uid = $this->user_profile->id;
     if (!in_array($uid, self::$the_staff_uids)) {
         return;
     }
     $from = $xml->FromUserName;
     $to = $xml->ToUserName;
     $content = '';
     switch ($text) {
         case self::STAFF_KW_RCTJ:
             $content = StaffUtil::get_richang_statis(date('Y-m-d'));
             break;
         default:
             break;
     }
     if (!$content) {
         return;
     }
     $this->wx_reply->imm_reply_text($to, $from, $content);
     return;
 }
示例#2
0
 private function do_lantozui_data_center($xml)
 {
     $type = $xml->MsgType;
     $from = $xml->FromUserName;
     $to = $xml->ToUserName;
     $content = '暂未支持该关键词回复哦';
     if ($type == 'text') {
         $text = trim('' . $xml->Content);
         if (in_array($text, self::$the_staff_keywords)) {
             switch ($text) {
                 case self::STAFF_KW_RCTJ:
                     $content = StaffUtil::get_richang_statis(date('Y-m-d'));
                     break;
                 default:
                     break;
             }
         }
     } elseif ($type == 'event') {
         $e = strtolower($xml->Event);
         if ($e == 'click') {
             $event = trim('' . $xml->EventKey);
             if (in_array($event, self::$the_staff_events)) {
                 switch ($text) {
                     case self::STAFF_EVENT_RCTJ:
                         $content = StaffUtil::get_richang_statis(date('Y-m-d'));
                         break;
                     default:
                         break;
                 }
             }
         }
     }
     return $content;
 }