短信: 修改重发策略: 第一次发送失败后通知以便修改,失败原因是手机号错误且重发时未变更手机号则不发送

feature/trippest
lyt 7 years ago
parent 8158cab00a
commit 8ca3999c65

@ -82,6 +82,23 @@ class Send_operation extends CI_Controller {
echo "已过期";
return;
}
$has_send = false;
$send_history = $this->send_model->order_sms_list($order->COLI_SN);
if ( ! empty($send_history)) {
$has_send = true;
$new_number = mb_ereg_replace('[\D]', '', $order->GUT_POST) . real_phone_number($order->GUT_TEL, mb_ereg_replace('[\D]', '', $order->GUT_POST));
$last_send = end($send_history);
$last_send_number = $last_send->TPSL_nationCode . $last_send->TPSL_mobile;
$last_send_cb = json_decode($last_send->TPSL_callbackJson);
if ($last_send_cb->result == 1016 && $new_number == $last_send_number) {
// 更新时间, 以免一直重复在这个订单
$update_cb_db['TPSL_logTime'] = date("Y-m-d H:i:s");
$update_where = " TPSL_SN=" . $last_send->TPSL_SN;
$ht_id = $this->send_model->update_trippest_sms_log($update_where, $update_cb_db);
echo "手机号错误且未变更";
return;
}
}
$last_update = "";
$guide_name = "";
if ($order->gcod != null) {
@ -125,31 +142,33 @@ class Send_operation extends CI_Controller {
$ht_id = $this->send_model->update_trippest_sms_log($update_where, $update_cb_db);
$send_cb_obj->errmsg!=="OK" ? $error_msg=$send_cb_obj->errmsg : null;
}
if ($time_flag === "try1") {
return;
}
if ($guide_name == null || $error_msg !== "") {
// 没有调度或发送失败
// to Alex
$operator_mailbody = "<p> Dear Alex: </p>" .
"<p>导游信息发送客人失败:<br /></p>" .
"<p>订单号:" . $order->COLI_ID ."</p>" .
"<p>发团时间:" . substr($order->COLD_StartDate, 0, 10) ."</p>" .
"<p>导游信息:" . $guide_name . "(" . $guide_tel . ")" ."</p>" .
"<p>导游更新时间:" . $last_update ."</p>" .
"<p>发送时间:" . $send_time ."</p>";
if ($error_msg !== "") {
$operator_mailbody .= "<p>发送失败信息:" . $error_msg . "</p>";
// if ($time_flag === "try1") {
// return;
// }
if ($has_send == false) {
if ($guide_name == null || $error_msg !== "") {
// 没有调度或发送失败
// to Alex
$operator_mailbody = "<p> Dear Alex: </p>" .
"<p>导游信息发送客人失败:<br /></p>" .
"<p>订单号:" . $order->COLI_ID ."</p>" .
"<p>发团时间:" . substr($order->COLD_StartDate, 0, 10) ."</p>" .
"<p>导游信息:" . $guide_name . "(" . $guide_tel . ")" ."</p>" .
"<p>导游更新时间:" . $last_update ."</p>" .
"<p>发送时间:" . $send_time ."</p>";
if ($error_msg !== "") {
$operator_mailbody .= "<p>发送失败信息:" . $error_msg . "</p>";
}
$operator_mailbody .= "<p><a href='https://www.trippest.com/track-your-trip/'>Tracking Link</a>.</p>";
$operator_mailbody .= "<p> 此邮件由系统自动发送, 请勿回复.</p>";
$this->send_model->SendMail(
"chinahighlights",
"webform@chinahighlights.net",
"YSL",
"alex@chinahighlights.net", // ysl email alex@chinahighlights.net
'#SMS send fail# ' . $order->COLI_ID,
$operator_mailbody);
}
$operator_mailbody .= "<p><a href='https://www.trippest.com/track-your-trip/'>Tracking Link</a>.</p>";
$operator_mailbody .= "<p> 此邮件由系统自动发送, 请勿回复.</p>";
$this->send_model->SendMail(
"chinahighlights",
"webform@chinahighlights.net",
"YSL",
"alex@chinahighlights.net", // ysl email alex@chinahighlights.net
'#SMS send fail# ' . $order->COLI_ID,
$operator_mailbody);
}
echo "已发送";
return;

Loading…
Cancel
Save