|
- <?php
-
- namespace backend\modules\hotel\controllers;
-
- use yii\web\Controller;
- use common\components\zOfficeWechat;
-
- class BaseController extends Controller
- {
-
- CONST AGENT_ALI_HOTEL_ID = '1000005'; //阿里酒店直连通知
- CONST AGENT_COMMON_HOTEL_ID = '1000002'; //普通酒店直连通知&携程酒店直连通知
- public $layout = "@backend/modules/hotel/views/layouts/iframe_new";
- public $_messageList = 'gaoj|panlj|wuwh|jim|zhuym|huangjq|huyz|'; //客服
- public $_business = 'yangxt|panlj|xiaoq|sunh|chengss|wuwh|jiny|'; //运营
- public $_developerList = 'shifp|wanglg|'; //技术
- public $_financeList = 'huangq|'; // 财务
- public $_private = 'wanglg|';
-
-
- /**
- * Author:Steven
- * Desc:
- * @param $title //通知标题
- * @param $msg //内容
- * @param string $touser 空:通知技术;1:技术+客服;2:技术+运营;3:运营+客服;4:运营+客服+技术 其他:自定义(例如:shifp|wanglg)
- */
- public function sendAliMsgToRtx($title, $msg, $touser = '', $agentid = self::AGENT_ALI_HOTEL_ID)
- {
- if ($touser == '') {
- $touser = $this->_developerList;
- } elseif ($touser == 1) { // 技术+客服
- $touser = $this->_developerList . $this->_messageList;
- } elseif ($touser == 2) { //技术+运营
- $touser = $this->_developerList . $this->_business;
- } elseif ($touser == 3) { //运营+客服
- $touser = $this->_messageList . $this->_business;
- } elseif ($touser == 4) { //运营+客服+技术
- $touser = $this->_developerList . $this->_messageList . $this->_business;
- }elseif($touser == 5)
- {
- $touser = $this->_private;
- }
- //警报:RTX通知
- $arr = array(
- "agentid" => $agentid,
- "title" => $title,
- "msg" => $msg,
- "touser" => $touser,
- );
- zOfficeWechat::sendMsg($arr);
- }
- }
|