From 07f28b3c050d5eb25cf9304709d9fae42bbc73eb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 27 Jan 2019 20:50:02 +0800 Subject: [PATCH] rename sendMsg -> sendKefuMsg --- webapp/controller/KefuController.class.php | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 4dc03ab..eed0f3c 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -187,9 +187,9 @@ class KefuController { } } - public function sendMsgAllUser() + public function sendKefuMsgAllUser() { - error_log('sendMsgAllUser:'); + error_log('sendKefuMsgAllUser:'); error_log('request:' . json_encode($_REQUEST)); if (phpcommon\md5Sign(array ( @@ -247,7 +247,7 @@ class KefuController { } } - private function sendMsg($accountid, $data) + private function sendKefuMsg($accountid, $data) { $postarray = json_encode($data, JSON_UNESCAPED_UNICODE); //POST发送https请求客服接口api @@ -260,16 +260,14 @@ class KefuController { return; } $ret_info = json_decode($response, true); - #error_log('sendMsgRet:' . $response); + #error_log('sendKefuMsgRet:' . $response); if ($ret_info['errcode'] == 0) { - } else { - #error_log('sendMsg发送失败!'); echo(0); } } - private function sendMsgSomeUser($arrayInfo) + private function sendKefuMsgSomeUser($arrayInfo) { foreach($arrayInfo as $userInfo) { $shareInfo = require('../config/kefu.share.config.php'); @@ -279,7 +277,7 @@ class KefuController { "msgtype" => "miniprogrampage", "miniprogrampage" => $miniprogrampateInfo ); - $this->sendMsg($userInfo['accountid'], $data); + $this->sendKefuMsg($userInfo['accountid'], $data); } } @@ -296,7 +294,7 @@ class KefuController { for ($i = 0; $i < $selectTimes; $i++ ) { #error_log('selectMin:' . $selectMin); $arrayInfo = $this->getAccountsKefuInfo($selectMin, $selectMin + $selectOneCount, $conn); - $this->sendMsgSomeUser($arrayInfo); + $this->sendKefuMsgSomeUser($arrayInfo); $selectMin = $selectMin + $selectOneCount; } } @@ -309,7 +307,7 @@ class KefuController { $gameid = phpcommon\extractGameId($accountid); $awardConfig = $this->getAwardConfig($gameid, $text); if (!isset($awardConfig)) { - $this->sendMsg($accountid, array ( + $this->sendKefuMsg($accountid, array ( "touser" => $openid, "msgtype" => "text", "text" => array ("content" => '回复指定文字领取奖励!') @@ -323,7 +321,7 @@ class KefuController { ':accountid' => $accountid, )); if ($row && time() - $row['awardtime'] < 3600 * 24) { - $this->sendMsg($accountid, array ( + $this->sendKefuMsg($accountid, array ( "touser" => $openid, "msgtype" => "text", "text" => array ("content" => "一天内只能领取一次奖励!\n请明天再来!") @@ -340,7 +338,7 @@ class KefuController { ':awardtime' => time() )); if ($ret) { - $this->sendMsg($accountid, array ( + $this->sendKefuMsg($accountid, array ( "touser" => $openid, "msgtype" => "text", "text" => array ("content" => '奖励领取成功,请查收邮件!') @@ -370,7 +368,7 @@ class KefuController { ':awardtime' => 0 )); if ($ret) { - $this->sendMsg($accountid, array( + $this->sendKefuMsg($accountid, array( "touser" => $msg['FromUserName'], "msgtype" => "text", "text" => array("content" => "您好,有什么能帮助你? \n回复指定文字领取奖励。 ")