getConfirmedOrders(); if (!$order_arr) { return; } //2,循环自由行订单组发送短信 foreach ($order_arr as $k => $v) { //2.1,获取需要发送的短信内容 $res_arr = $this->getMsgContent($v['tourist_id'], $v['order_title_id']); if ($res_arr) { //2.2,发送短信 $tmp = $order_title->updateMsgStatus($v['order_title_id']); if (!$tmp) { return; } $send_res = Msg::sendTelMsg($res_arr['phone'], $res_arr['content'],$v['main_corp_id']); //2.3,短信发送记录存入数据库 OrderSendMessage::addTouristMsg($v['order_title_id'], $res_arr['phone'], $res_arr['content'], $send_res, 1); } } } /** * Function Description:获取该自由行产品需要发送的短信内容 * Function Name: getMsgContent * @param int $tourist_id 自由行产品id * * @return array * * @author 温依莅 */ public function getMsgContent($tourist_id, $order_title_id) { $order_title = new OrderTitle(); //1,获取短信模板内容 $tourist_res = OperaTouristCommon::getTouristMsg($tourist_id); if (!isset($tourist_res['message'])) { return array(); } $content = $tourist_res['message']; //2,根据自由行订单新替换通配符得到短信发送内容 $title_res = $order_title->getTitleInfo($order_title_id); $phone = $title_res['cus_phone']; $content = str_replace("{成人数}", $title_res['adult_num'], $content); $content = str_replace("{儿童数}", $title_res['child_num'], $content); $content = str_replace("{出发日期}", $title_res['start_date'], $content); $content = str_replace("{产品名}", $title_res['order_title_prod_name'], $content); return array('phone' => $phone, 'content' => $content); } public function ctripNoticeOrderCancel() { $orderTitleCancelRequest = new OrderTitleCancelRequest(); $getCancelOutTimes = $orderTitleCancelRequest->getCancelOutTimes(); if (empty($getCancelOutTimes['0']['order_title_id'])) { return Util::returnArrSu('no doing'); } foreach ($getCancelOutTimes as $val) { $order_id = $val['order_title_id']; CtripUtil::NoticeOrderCancel($order_id, 4); } return Util::returnArrSu(); } }