$shopAdmin) { InformAdminClass::addInform($params, $shopAdmin, $type, $TMList); } } //消费通知内容 shish 2020.1.1 //['messageType'=>'inform','informWay'=>'miniProgram','userType'=>'admin','shopAdminId'=>913,'mobile'=>'15280215347','tMessage'=>'','content'=>'','briefContent'=>'','isOpen'=>1] public static function consumeInformQueue($data) { $informWay = $data['informWay']; $shopAdminId = isset($data['shopAdminId']) ? $data['shopAdminId'] : 0; if (empty($shopAdminId)) { echo "\n 没有找到门店管理员 \n"; util::end(); } $shopAdmin = ShopAdminClass::getById($shopAdminId); $merchantId = $shopAdmin['merchantId']; $adminId = $shopAdmin['adminId']; $mobile = $data['mobile']; $isOpen = isset($data['isOpen']) ? $data['isOpen'] : 0; $merchant = WxOpenService::getWxInfo(); $hasSend = 0; $noticeWay = 0; if ($informWay == 'wx') { $tMessage = json_decode($data['tMessage'], true); $r = wxUtil::sendTaskInform($tMessage, $merchant, $isOpen); print_r($r); $hasSend = 1; $noticeWay = 0; } elseif ($informWay == 'sms') { $msg = $data['content']; sms::merchantSend($mobile, $msg, $merchant); $hasSend = 1; $noticeWay = 1; } elseif ($informWay == 'miniProgram') { $tMessage = json_decode($data['tMessage'], true); $r = wxUtil::sendTaskInform($tMessage, $merchant); print_r($r); $hasSend = 1; $noticeWay = 0; } else { } //存入数据库 $informData = [ 'adminId' => $adminId, 'merchantId' => $merchantId, 'noticeType' => 0, 'content' => $data['briefContent'], 'noticeWay' => $noticeWay, 'status' => $hasSend, 'sourceType' => 0, 'sourceId' => 0, 'addTime' => time(), 'createTime' => date("Y-m-d H:i:s"), ]; InformAdminClass::addData($informData); return true; } }