Example #1
0
 if (C('SMS_SEND')) {
     if (in_array("sms", $type_arr)) {
         $r = $noticeApiCurd->actSmsSurNum($from);
         $flag = $r['ret'];
         if ($flag == "ok") {
             //2014/08/19 判断是否可发送
             $table = "nt_sms";
             //单条发送消息start
             foreach ($to_detail as $to_detail_val) {
                 $to_name = $to_detail_val['to_name'];
                 if (in_array($to_name, $noMobile)) {
                     continue;
                 }
                 $to_mobile = $to_detail_val['to_mobile'];
                 $to_login_name = $to_detail_val['to_login_name'];
                 $res_sms = Sms::send_sms_post($to_mobile, $content . "【华成云商】", '');
                 $status = substr($res_sms, 0, strpos($res_sms, "/"));
                 //000 短信表示成功
                 if ($status !== '000') {
                     $smSendFail[] = $to_name;
                 }
                 $data = array("from_mobile" => $from_mobile, "to_mobile" => $to_mobile, "content" => post_check($content), "from_name" => $from, "to_name" => $to_name, "addtime" => time(), "status" => $status, "from_login_name" => $from_login_name, "to_login_name" => $to_login_name, "client_ip" => $client_ip);
                 $result = $noticeApiCurd->actInsert($data, $table);
             }
             //单条发送消息end
         } else {
             $sms_stop = true;
         }
     }
 } else {
     $sms_send = false;