本文整理匯總了PHP中Sms::endSms方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sms::endSms方法的具體用法?PHP Sms::endSms怎麽用?PHP Sms::endSms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sms
的用法示例。
在下文中一共展示了Sms::endSms方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: payReturn
protected function payReturn()
{
// $data = D('busines_second');
// $t_busines = D('busines');
$tb_resbook = D('reservebook');
$orderid = filter_var($this->_get('orderid'), FILTER_SANITIZE_STRING);
$token = filter_var($this->_get('token'), FILTER_SANITIZE_STRING);
$checkOrder = $tb_resbook->where(array('orderid' => $orderid, 'token' => $token))->find();
//根據訂單號查出$order
if ($checkOrder) {
//如果訂單存在
if ($checkOrder['paid'] === 1) {
//支付成功,發信息,跳轉到訂單別表頁麵
$this->assign('type', $checkOrder['type']);
$this->assign('token', $checkOrder['token']);
$this->assign('wecha_id', $checkOrder['wecha_id']);
//發送給商家
Sms::sendSms($checkOrder['token'], "親愛的,您的會員 {$checkOrder['truename']},已經購買了{$checkOrder['orderName']} 並付款成功,金額為{$checkOrder['payprice']},訂單號為{$checkOrder['orderid']}. " . date('Y-m-d H:i:s', time()));
//發給單個連鎖商家
// Sms::sendSms(token_商家ID, 短信內容);
//發送給粉絲
Sms::endSms($checkOrder['token'], "親愛的 {$checkOrder['truename']},您購買的{$checkOrder['orderName']} 已經付款成功,金額為{$checkOrder['payprice']},訂單號為{$checkOrder['orderid']},感謝您惠顧! " . date('Y-m-d H:i:s', time()), $checkOrder['tel']);
self::mylist();
exit;
} else {
//如果沒支付,則進入另外一個判斷,如果訂單沒有支付,這裏應該回滾庫存.setInc()
M('busines_second')->where(array('sid' => $checkOrder['rid'], 'type' => $checkOrder['type'], 'token' => $checkOrder['token']))->setInc('googsnumber');
}
} else {
// $this->redirect('Business/index', array('token'=>$this->_get('token'),
// 'wecha_id'=>$this->_get('wecha_id'),'type'=>$this->_get('type'),'bid'=>$this->_get('bid'),
// 'sid'=>$this->_get('sid')), 2, '您好,係統裏沒有該訂單...');
exit('訂單不存在!');
}
}
示例2: yysave
public function yysave()
{
if (IS_POST) {
$t_book = M('reservebook');
$_POST['wecha_id'] = trim(filter_var($this->_post('wecha_id'), FILTER_SANITIZE_STRING));
$_POST['token'] = trim(filter_var($this->_post('token'), FILTER_SANITIZE_STRING));
$_POST['truename'] = trim(filter_var($this->_post('truename'), FILTER_SANITIZE_STRING));
$_POST['tel'] = trim(filter_var($this->_post('mobile'), FILTER_SANITIZE_STRING));
$_POST['housetype'] = trim(filter_var($this->_post('housetype'), FILTER_SANITIZE_STRING));
$_POST['info'] = trim(filter_var($this->_post('info'), FILTER_SANITIZE_STRING));
$_POST['type'] = trim(filter_var($this->_post('type'), FILTER_SANITIZE_STRING));
$_POST['dateline'] = trim(filter_var($this->_post('dateline'), FILTER_SANITIZE_STRING));
$_POST['address'] = trim(filter_var($this->_post('address'), FILTER_SANITIZE_STRING));
$_POST['choose'] = trim(filter_var($this->_post('choose'), FILTER_SANITIZE_STRING));
$_POST['booktime'] = time();
$_POST['rid'] = trim(filter_var($this->_post('rid'), FILTER_VALIDATE_INT));
$token = trim(filter_var($this->_get('token'), FILTER_SANITIZE_STRING));
$wecha_id = trim(filter_var($this->_get('wecha_id'), FILTER_SANITIZE_STRING));
$joinnum = $t_book->where(array('token' => $_POST['token'], 'rid' => $_POST['rid'], 'type' => $_POST['type']))->count();
$t_res = M('reservation');
$countnum = $t_res->where(array('token' => $_POST['token'], 'addtype' => $_POST['type'], 'id' => $_POST['rid']))->getField('typename2');
$url = 'http://' . $_SERVER['HTTP_HOST'];
if ($joinnum >= $countnum) {
$url .= U('School/public_list', array('token' => $token, 'wecha_id' => $wecha_id, 'type' => 'course'));
echo json_encode(array('errno' => 3, 'token' => $token, 'wecha_id' => $wecha_id, 'msg' => "非常抱歉,該課程已經滿員,您可以看看別的選課.", 'url' => $url));
exit;
}
$id = $t_book->data($_POST)->add();
if ($id) {
//發送給商家
Sms::sendSms($_POST['token'], "{$_POST['truename']},預約了 {$_POST['choose']} 老師的 {$_POST['housetype']}. " . date('Y-m-d H:i:s', time()));
//發給單個連鎖商家
// Sms::sendSms(token_商家ID, 短信內容);
//發送給粉絲
Sms::endSms($_POST['token'], "親愛的 {$_POST['truename']},您預約的 由 {$_POST['choose']} 課程 [{$_POST['housetype']}],預約成功! " . date('Y-m-d H:i:s', time()), $_POST['tel']);
$url .= U('School/mylist', array('token' => $token, 'wecha_id' => $wecha_id, 'rid' => $_POST['rid'], 'type' => 'course', 'check' => time()));
$arr = array('errno' => 1, 'token' => $token, 'wecha_id' => $wecha_id, 'url' => $url);
echo json_encode($arr);
exit;
} else {
$arr = array('errno' => 2, 'token' => $token, 'wecha_id' => $wecha_id);
echo json_encode($arr);
exit;
}
}
}