示例#1
0
 /**
  * 警告
  * @param $audit
  */
 private function _warning($audit)
 {
     $message = $this->_punishMsg($audit);
     $msg = '您发布了假房源(' . $message . '),这么任性可不好。如果再任性,我只能残忍地将您关进小黑屋,' . Const_Fyk::DETENTION_TIME . '天内无法再使用房源库哦~~';
     $brokerInfo = Bll_Broker_User::getBrokerInfoByUserId(intval($audit['userId']));
     if ($brokerInfo) {
         $chatInfos = Model_Mobile_BrokerChatInfo::getActiveBrokerIdsCV(array($brokerInfo['brokerId']));
         if (!empty($chatInfos)) {
             $chatInfo = $chatInfos[0];
             $i = 0;
             do {
                 $i++;
                 $isPush = Bll_Mobile_ChatInfoBll::sendFykPublicMsgTxt($chatInfo['chatId'], $msg);
             } while (!$isPush && $i < 4);
         }
         if (empty($isPush)) {
             $this->setLog(date('Y-m-d H:i:s') . ' - broker_id: ' . $brokerInfo['brokerId'] . ', API call failure ');
         }
         if (!empty($isPush) && $isPush['data']['status'] == 'ERROR') {
             //如果api调用成功,但是执行失败,则记录日志
             $this->setLog(date('Y-m-d H:i:s') . ' - broker_id: ' . $brokerInfo['brokerId'] . ', warning failure:' . $isPush['data']['errorCode'] . '(' . $isPush['data']['errorMessage'] . ')');
         }
     }
     $this->_insertDataByType($audit, Model_Fyk_UserPunish::WARNING);
 }