本文整理汇总了PHP中Sms::noticeSms方法的典型用法代码示例。如果您正苦于以下问题:PHP Sms::noticeSms方法的具体用法?PHP Sms::noticeSms怎么用?PHP Sms::noticeSms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sms
的用法示例。
在下文中一共展示了Sms::noticeSms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addExpress
public function addExpress()
{
ignore_user_abort(0);
set_time_limit(0);
if ($this->isPost()) {
$data['pid'] = $_POST['pid'];
$data['message'] = $_POST['message'];
$data['is_important'] = $_POST['is_important'];
$data['ctime'] = date("Y-m-d H:i:s");
$mod = M('PingPexpress');
$id = $mod->add($data);
if ($id) {
M("Ping")->where("id='" . $data['pid'] . "'")->save(array('status' => $_POST['status']));
$orders = M("PingOrder")->where("pid='" . $data['pid'] . "'")->group("mobile")->select();
foreach ($orders as $order) {
$data['orderid1'] = $order['orderid1'];
M("PingExpress")->add($data);
if ($data['is_important']) {
//发送短信
$sms = new Sms();
$tinyurl = tinyurl($this->baseurl . "?m=Ping&a=myorder&pid=" . $order['pid']);
$tinyurl = $tinyurl ? $tinyurl : $this->baseurl . "?m=Ping&a=myorder&pid=" . $order['pid'];
$content = $data['message'] . " 查看订单" . $tinyurl . "";
if (preg_match('/\\d{11}/', $order['mobile'])) {
$smsresult = $sms->noticeSms($order['mobile'], $content);
}
}
}
$this->success('操作成功', U('Ping/addExpress', array("id" => $data['pid'])));
} else {
$this->error('error');
}
} else {
$pid = $_GET['id'];
$pids = M("PingPexpress")->where("pid='" . $pid . "'")->order("id desc")->select();
$ping = M("Ping")->where("id='" . $pid . "'")->find();
$this->assign("ping", $ping);
$this->assign("pids", $pids);
$this->assign("pid", $pid);
$this->assign("pingStatus", $this->ping_status);
$this->display();
}
}