本文整理汇总了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;
}
}
}