本文整理汇总了PHP中Sms类的典型用法代码示例。如果您正苦于以下问题:PHP Sms类的具体用法?PHP Sms怎么用?PHP Sms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Sms类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: actionDelete
public function actionDelete()
{
$id = $this->_get('id');
$user_id = $this->_get('user_id');
$obj = User::model()->findByPk($user_id);
if ($id && Report::model()->deleteByPk($id)) {
$mobile = $obj->mobile;
if (isset($mobile) && $mobile) {
// $type =='register','forget',
$sms = new Sms();
$result = $sms->sendSMS($mobile, '您好,你的反馈我们已近收到,我们将尽快处理,Urtime谢谢你的宝贵意见', 'true');
$result = $sms->execResult($result);
if ($result[1] == 0) {
// echo '发送成功';
Yii::app()->user->setFlash('send', 1);
$this->redirect(array('report/index'));
} else {
//echo "发送失败{$result[1]}";
Yii::app()->user->setFlash('send', 0);
$this->redirect(array('report/index'));
}
} else {
Yii::app()->user->setFlash('report', 0);
$this->redirect(array('report/index'));
}
} else {
Yii::app()->user->setFlash('report', 0);
$this->redirect(array('report/index'));
}
}
开发者ID:kl0428,项目名称:admin,代码行数:30,代码来源:ReportController.php
示例2: actionLogin
public function actionLogin()
{
$data = array();
$params = Yii::$app->request->getBodyParams();
if (isset($params['acc_device_token'])) {
$devisetoken = $params['acc_device_token'];
} else {
$devisetoken = "";
}
$sms = new Sms();
$vcode = $sms->checkVerifyCode($params['mobile'], $params['code'])['error'];
if ($vcode == 0) {
$userdata = Accounts::get_user_by_mobile($params['mobile']);
if (empty($userdata)) {
$access_token = Yii::$app->security->generateRandomString();
$this->userReg($params['mobile'], $devisetoken, $access_token);
$userdata = Accounts::get_user_by_mobile($params['mobile']);
if (!$userdata) {
return Message::say(Message::E_ERROR, null, "登录错误");
}
}
return Message::say(Message::E_OK, $userdata, "登录成功");
} else {
return Message::say(Message::E_ERROR, null, "验证码错误");
}
}
开发者ID:szucyq,项目名称:zhaopin,代码行数:26,代码来源:SiteController.php
示例3: sendSms
public function sendSms($params = array())
{
//extract($params);
$type = $params['type'];
$mobile = $params['mobile'];
if (isset($type) && isset($mobile)) {
// $type =='register','forget',
$num = $this->getrandstr();
$cache = Yii::app()->cache;
$cache->hset($mobile, $type, $num);
$sms = new Sms();
$result = $sms->send($mobile, '【Urtime】您的注册验证码是:' . $num . '.请完成注册', true);
$res = $sms->execResult($result);
if ($res[1] == 0) {
// echo '发送成功';
$ret = $this->notice('OK', 0, '', $result);
} else {
//echo "发送失败{$result[1]}";
$ret = $this->notice('ERR', 307, '', $result);
}
} else {
$ret = $this->notice('ERR', 301, '', array('mobile' => isset($mobile) ? $mobile : 0, 'type' => isset($type) ? $type : ''));
}
return $ret;
}
开发者ID:kl0428,项目名称:urtime,代码行数:25,代码来源:SmsService.php
示例4: send
/**
* 发送验证码
*/
public static function send($mobile)
{
$code = mt_rand('100000', '999999');
$Sms = new Sms($mobile, $code);
if ($Sms->send()) {
M('app_sms_code')->add(['phone' => $mobile, 'code' => $code, 'ctime' => time()]);
}
}
开发者ID:xiangku7890,项目名称:basic,代码行数:11,代码来源:Super.class.php
示例5: actionSend
public function actionSend()
{
$model = new Sms();
if (isset($_POST['Sms'])) {
$model->attributes = $_POST['Sms'];
if ($model->validate() && $model->send()) {
$this->refresh();
}
}
$this->render('/sms/send', ['model' => $model]);
}
开发者ID:rahmanjis,项目名称:dipstart-development,代码行数:11,代码来源:SmsController.php
示例6: my_login_redirect
/**
* Redirect user after successful login.
*
* @param string $redirect_to URL to redirect to.
* @param string $request URL the user is coming from.
* @param object $user Logged user's data.
* @return string
*/
function my_login_redirect($redirect_to, $request, $user)
{
//is there a user to check?
if (!is_user_logged_in()) {
$redirect_to;
}
$hp = get_user_meta($user->ID, 'phone', true);
$sms = new Sms();
$r = $sms->send($hp, "Notifikasi Login\nYth {$user->display_name}, Anda baru saja login. Kalau itu bukan anda, harap laporkan pada admin.\nstaff.stiba.ac.id");
return $redirect_to;
}
开发者ID:xflash8,项目名称:staff-2016,代码行数:19,代码来源:login.php
示例7: actionIndex
/**
* 首页
*
*/
public function actionIndex()
{
parent::_acl('sms_index');
$model = new Sms();
$criteria = new CDbCriteria();
$criteria->order = 'id DESC';
$count = $model->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 10;
$criteria->limit = $pages->pageSize;
$criteria->offset = $pages->currentPage * $pages->pageSize;
$result = $model->findAll($criteria);
$this->render('index', array('datalist' => $result, 'pagebar' => $pages));
}
开发者ID:zywh,项目名称:maplecity,代码行数:18,代码来源:SmsController.php
示例8: statusUpdate
public function statusUpdate($order_id)
{
$this->load->model('checkout/order');
$this->load->model('module/smsapi');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info['order_status_id'] != 0) {
$message = $this->model_module_smsapi->get_status($order_info['order_status_id'])[0]['description'];
$customer_msg = new Message($order_info, $message);
$customer_message = $customer_msg->get_customer_message();
$options = array('special_chars' => $this->model_module_smsapi->get_settings()[0]['special_chars'], 'fast' => $this->model_module_smsapi->get_settings()[0]['fast']);
$db_sender = $this->model_module_smsapi->get_settings()[0]['sender'];
$username = $this->model_module_smsapi->get_settings()[0]['smsapi_username'];
$password = $this->model_module_smsapi->get_settings()[0]['smsapi_password'];
$admin_phone = $this->model_module_smsapi->get_settings()[0]['admin_phone'];
$sms = new Sms($options, $db_sender, $username, $password);
if (!$this->model_module_smsapi->get_order($order_info['order_id']) && $this->model_module_smsapi->get_settings()[0]['new_order']) {
$this->model_module_smsapi->set_order($order_info);
$message = $this->model_module_smsapi->get_settings()[0]['new_order_message'];
$admin_msg = new Message($order_info, $message);
$admin_message = $admin_msg->get_admin_message();
$result = $sms->send($admin_phone, $admin_message);
if (is_string($result)) {
$this->model_module_smsapi->add_history($result);
} else {
$this->model_module_smsapi->add_history($admin_message);
}
if ($this->model_module_smsapi->get_status($order_info['order_status_id'])[0]['checked']) {
$result = $sms->send($order_info['telephone'], $customer_message);
if (is_string($result)) {
$this->model_module_smsapi->add_history($result);
} else {
$this->model_module_smsapi->add_history($customer_message);
}
}
}
if ($this->model_module_smsapi->get_settings()[0]['change_order_status']) {
if ($this->model_module_smsapi->get_status($order_info['order_status_id'])[0]['checked']) {
$this->model_module_smsapi->set_order($order_info);
$result = $sms->send($order_info['telephone'], $customer_message);
if (is_string($result)) {
$this->model_module_smsapi->add_history($result);
} else {
$this->model_module_smsapi->add_history($customer_message);
}
}
}
}
}
开发者ID:rafalszewc,项目名称:smsapi-opencart,代码行数:48,代码来源:smsapi.php
示例9: POST_phoneAction
/**
* 发送手机验证码
* @method POST_phoneAction
* @author NewFuture
*/
public function POST_phoneAction()
{
$response['status'] = 0;
if (!Input::post('phone', $phone, Config::get('regex.phone'))) {
$response['info'] = '手机号格式有误或者不支持!';
} elseif (!Input::post('account', $account, Config::get('regex.account'))) {
$response['info'] = '账号有误,如果账号忘记请联系云印工作人员';
} elseif (!($Printer = PrinterModel::where('account', $account)->field('id,phone')->find())) {
$response['info'] = '尚未注册';
} elseif (!Safe::checkTry('pwd_phone_' . $account)) {
$response['info'] = '尝试次数过多,临时封禁!';
} elseif (!$Printer['phone'] || $Printer['phone'] != $phone) {
$response['info'] = '绑定手机不一致,或者手机号错误';
} elseif (!Sms::findPwd($phone, $code = Random::number(6))) {
$response['info'] = '短信发送出错,请联系我们!';
} else {
/*发送成功*/
$find = ['id' => $Printer['id'], 'account' => $account, 'code' => strtoupper($code)];
Session::set('find_info_p', $find);
Safe::del('pwd_phone_' . $account);
$response['status'] = 1;
$response['info'] = '验证短信已发送';
}
$this->response = $response;
}
开发者ID:derek-chow,项目名称:YunYinService,代码行数:30,代码来源:Password.php
示例10: POST_phoneAction
/**
* 发送手机验证码
* @method POST_phoneAction
* @author NewFuture
*/
public function POST_phoneAction()
{
$response['status'] = 0;
if (!Input::post('phone', $phone, Config::get('regex.phone'))) {
$response['info'] = '手机号格式有误或者不支持!';
} elseif (!Input::post('number', $number, 'card')) {
$response['info'] = '学号格式有误!';
} elseif (!Safe::checkTry('pwd_phone_' . $number)) {
$response['info'] = '尝试次数过多,临时封禁!';
} elseif (!($user = UserModel::where('number', $number)->field('id,phone')->find())) {
$response['info'] = '尚未注册,或者学号错误';
} elseif (empty($user['phone'])) {
$response['info'] = '未绑定手机号,或者学号错误';
} elseif (Encrypt::encryptPhone($phone, $number, $user['id']) != $user['phone']) {
$response['info'] = '绑定手机不一致,或者手机号错误';
} elseif (!Sms::findPwd($phone, $code = Random::code(6))) {
$response['info'] = '短信发送出错,请联系我们!';
} else {
/*发送成功*/
$find = ['id' => $user['id'], 'number' => $number, 'code' => strtoupper($code)];
Session::set('find_info', $find);
Safe::del('pwd_phone_' . $number);
$response['status'] = 1;
$response['info'] = '短信已发送';
}
$this->response = $response;
}
开发者ID:derek-chow,项目名称:YunYinService,代码行数:32,代码来源:Password.php
示例11: postInsert
public function postInsert($event)
{
$company = $this->getCreator()->getGroups()->getFirst();
// notify it-admins
if ($company) {
$subject = Email::generateSubject($this);
$text = 'Заявка от компании ' . $company->getName() . ', пользователь ' . $this->getCreator()->getUsername() . PHP_EOL . 'http://helpdesk.f1lab.ru/tickets/' . $this->getId();
// sms
if (true == ($notify = $company->getNotifySms())) {
$phones = [];
foreach ($notify as $user) {
if ($user->getPhone()) {
$phones[] = $user->getPhone();
}
}
Sms::send($phones, $text);
}
// email
if (true == ($notify = $company->getNotifyEmail())) {
$emails = [];
foreach ($notify as $user) {
if ($user->getEmailAddress()) {
$emails[] = $user->getEmailAddress();
}
}
Email::send($emails, $subject, $text);
}
}
// send email to creator
$to = $this->getRealSender() ?: $this->getCreator()->getEmailAddress();
Email::send($to, Email::generateSubject($this), EmailTemplate::newTicket($this));
}
开发者ID:vik0803,项目名称:helpdesk,代码行数:32,代码来源:Ticket.class.php
示例12: smssendtest
public function smssendtest()
{
if (strlen($_GET['mp']) != 11) {
$this->error('请输入正确的手机号');
}
$this->error(Sms::sendSms('admin', 'hello,你好', $_GET['mp']));
}
开发者ID:d0oo0b,项目名称:wechatcms,代码行数:7,代码来源:SiteAction.class.php
示例13: index
public function index($orderid, $paytype, $third_id)
{
$product_cart_model = M('product_cart');
$out_trade_no = $orderid;
$order = $product_cart_model->where(array('orderid' => $out_trade_no))->find();
if (!$this->wecha_id) {
$this->wecha_id = $order['wecha_id'];
}
$sepOrder = 0;
if (!$order) {
$order = $product_cart_model->where(array('id' => $out_trade_no))->find();
$sepOrder = 1;
}
if ($order) {
if ($order['paid'] != 1) {
exit('该订单还未支付');
}
/************************************************/
Sms::sendSms($this->token, '您的微信里有团购订单已经付款');
/************************************************/
header('Location:/index.php?g=Wap&m=Groupon&a=myOrders&token=' . $order['token'] . '&wecha_id=' . $order['wecha_id']);
} else {
exit('订单不存在:' . $out_trade_no);
}
}
开发者ID:node-rookie,项目名称:bdg,代码行数:25,代码来源:ThirdPayGroupon.class.php
示例14: actionReplyMessage
public function actionReplyMessage()
{
if (isset(Yii::app()->params['twilio']['replyMessage']) && Yii::app()->params['twilio']['replyMessage']) {
file_put_contents(Yii::app()->params['logDirPath'] . '/twilio_request.log', print_r($_REQUEST, true) . "\n\n", FILE_APPEND);
$phone = str_replace('+44', '', $_REQUEST['From']);
$client = Client::model()->findByPhone($phone);
$sms = new Sms();
$sms->clientId = $client ? $client->cli_id : 0;
$sms->receive($_REQUEST);
if ($client) {
$latestText = Sms::model()->latestTextToClient($client);
}
header('content-type: text/xml');
echo '<Response><Sms><![CDATA[' . Yii::app()->params['twilio']['replyMessage'] . ']]></Sms></Response>';
}
}
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:16,代码来源:TwilioController.php
示例15: index
public function index()
{
$set_id = $this->_get('id', 'intval');
$formData = $this->_createForms($this->token, $set_id);
if (IS_POST) {
$limit_info = $this->limit_db->where(array('limit_id' => $this->thisForm['limit_id']))->find();
if ($limit_info['enddate']) {
if ($limit_info['enddate'] < time()) {
$this->error('抱歉,时间已过期,无法提交');
}
}
if (0 < $limit_info['today_total']) {
$time = strtotime(date('Y-m-d'));
$total = $this->info_db->where(array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'set_id' => $this->thisForm['set_id'], 'add_time' => array('gt', $time)))->count();
if ($limit_info['today_total'] <= $total) {
$this->error('抱歉,今日只能提交' . $limit_info['today_total'] . '次');
}
}
if (0 < $limit_info['sub_total']) {
$total = $this->info_db->where(array('token' => $this->token, 'set_id' => $this->thisForm['set_id'], 'wecha_id' => $this->wecha_id))->count();
if ($limit_info['sub_total'] <= $total) {
$this->error('抱歉,提交总数已经超过' . $limit_info['sub_total'] . '次');
}
}
$data['token'] = $this->token;
$data['wecha_id'] = $this->wecha_id;
$data['set_id'] = $set_id;
$data['add_time'] = time();
$data['user_name'] = empty($this->fans['wechaname']) ? '匿名' : $this->fans['wechaname'];
$data['phone'] = empty($this->fans['tel']) ? '匿名' : $this->fans['tel'];
$array = array();
foreach ($this->_request() as $key => $value) {
if ($value == '') {
$array[] = array($key => '未填写');
}
}
$arr = array();
foreach ($array as $k => $v) {
foreach ($v as $key => $value) {
$arr[$key] = $value;
}
}
$b = $this->_request();
$request = array_merge($b, $arr);
$data['sub_info'] = $this->_serializeSubInfo($request, $set_id);
if ($this->info_db->add($data)) {
Sms::sendSms($this->token, '你的表单“' . $this->thisForm['title'] . '”中有新的信息');
$this->success($this->thisForm['succ_info']);
} else {
$this->error($this->thisForm['err_info']);
}
} else {
$spoor = $this->info_db->where(array('token' => $this->token, 'wecha_id' => $this->wecha_id, 'set_id' => $set_id))->count();
$this->assign('spoor', $spoor);
$this->assign('verify', $formData['verify']);
$this->assign('formData', $formData['string']);
$this->display();
}
}
开发者ID:hehekeke,项目名称:pigcms,代码行数:59,代码来源:CustomAction.class.php
示例16: get_short_message_verification_code
public function get_short_message_verification_code()
{
Logger::getRootLogger()->debug("Authentication::get_short_message_verification_code");
//Logger::getRootLogger()->debug(Utils::var2str(getallheaders()));
Logger::getRootLogger()->debug(Utils::get_http_raw());
$response = Utils::validate_request();
if (Utils::validate_request() !== null) {
echo Response::getResponseJson($response);
return;
}
$adv_infor = $_POST['request_json'];
Logger::getRootLogger()->debug("adv_infor = " . $adv_infor);
$adv_infor_array = json_decode($adv_infor, true);
Logger::getRootLogger()->debug("dump adv_infor_array:" . Utils::var2str($adv_infor_array));
if (!isset($adv_infor_array['DATA']['cellphone'])) {
$response->status = Response::STATUS_ERROR;
$response->error_code = "0003";
$response->message = "手机号不得为空";
return $response;
}
if (!preg_match($this->cellphone_pattern, $adv_infor_array['DATA']['cellphone'])) {
$response->status = Response::STATUS_ERROR;
$response->error_code = "0005";
$response->message = "无效的手机号码";
return $response;
}
$cellphone = $adv_infor_array['DATA']['cellphone'];
$code = sprintf("%06d", rand(0, 999999));
Utils::set_sms_code($cellphone, $code);
$sms = new Sms();
$ret = $sms->send($cellphone, $code);
if ($ret != 0) {
$response = new Response();
$response->status = Response::STATUS_ERROR;
$response->message = "短信校验码获取失败";
$response->error_code = "0027";
echo Response::getResponseJson($response);
return;
} else {
$response = new Response();
$response->status = Response::STATUS_OK;
$response->message = "短信校验码获取成功";
echo Response::getResponseJson($response);
return;
}
}
开发者ID:nightmarehelen,项目名称:dalaba,代码行数:46,代码来源:Authentication.php
示例17: index
public function index($orderid, $paytype = '', $third_id = '')
{
$wecha_id = '';
$token = '';
if ($order = M('dish_order')->where(array('orderid' => $orderid))->find()) {
//TODO 发货的短信提醒
$token = $order['token'];
$wecha_id = $order['wecha_id'];
//$order['paid']=1;
$Dishcompany = M('Dish_company')->where(array('cid' => $order['cid']))->find();
$kconoff = $Dishcompany['kconoff'];
if ($order['paid']) {
$temp = unserialize($order['info']);
$tmparr = array('token' => $token, 'cid' => $order['cid'], 'order_id' => $order['id'], 'paytype' => $order['paytype']);
$log_db = M('Dishout_salelog');
if (!empty($temp) && is_array($temp)) {
$DishDb = M('Dish');
$mDishSet = ThirdPayDishOut::getDishMainCompany($token);
foreach ($temp as $kk => $vv) {
$did = isset($vv['did']) ? $vv['did'] : $kk;
$dishofcid = $order['cid'];
if ($mDishSet['cid'] != $order['cid'] && $mDishSet['dishsame'] == 1) {
$dishofcid = $mDishSet['cid'];
$kconoff = $mDishSet['kconoff'];
}
$tmpdish = $DishDb->where(array('id' => $did, 'cid' => $dishofcid))->find();
if ($kconoff && !empty($tmpdish) && $tmpdish['instock'] > 0) {
$DishDb->where(array('id' => $did, 'cid' => $dishofcid))->setDec('instock', $vv['num']);
}
$logarr = array('did' => isset($vv['did']) ? $vv['did'] : $kk, 'nums' => $vv['num'], 'unitprice' => $vv['price'], 'money' => $vv['num'] * $vv['price'], 'dname' => $vv['name'], 'addtime' => $order['time'], 'addtimestr' => date('Y-m-d H:i:s', $order['time']), 'comefrom' => 0);
$savelogarr = array_merge($tmparr, $logarr);
$log_db->add($savelogarr);
}
}
$company = M('Company')->where(array('token' => $token, 'id' => $order['cid']))->find();
if (empty($company) || !is_array($company)) {
header('Location:' . U('DishOut/index', array('token' => $token, 'wecha_id' => $wecha_id)));
}
Sms::sendSms($token, "顾客{$order['name']}刚刚对订单号:{$orderid}的订单进行了支付,请您注意查看并处理", $company['mp']);
$model = new templateNews();
$siteurl = $_SERVER['HTTP_HOST'];
$siteurl = strtolower($siteurl);
if (strpos($siteurl, "http:") === false && strpos($siteurl, "https:") === false) {
$siteurl = 'http://' . $siteurl;
}
$siteurl = rtrim($siteurl, '/');
/*$model->sendTempMsg('OPENTM202521011', array('href' =>U('DishOut/myOrder', array('token' => $token, 'wecha_id' => $wecha_id, 'cid' => $order['cid']), true, false, true), 'wecha_id' => $wecha_id, 'first' => '外卖订餐交易提醒', 'keyword1' => $orderid, 'keyword2' => date("Y年m月d日H时i分s秒"), 'remark' => '支付成功,感谢您的光临,欢迎下次再次光临!'));*/
$model->sendTempMsg('OPENTM202521011', array('href' => $siteurl . '/index.php?g=Wap&m=DishOut&a=myOrder&token=' . $token . '&wecha_id=' . $wecha_id . '&cid=' . $order['cid'], 'wecha_id' => $wecha_id, 'first' => '外卖订餐交易提醒', 'keyword1' => $orderid, 'keyword2' => date("Y年m月d日H时i分s秒"), 'remark' => '支付成功,感谢您的光临,欢迎下次再次光临!'));
$op = new orderPrint();
$msg = array('companyname' => $company['name'], 'des' => htmlspecialchars_decode($order['des'], ENT_QUOTES), 'companytel' => $company['tel'], 'truename' => htmlspecialchars_decode($order['name'], ENT_QUOTES), 'tel' => $order['tel'], 'address' => htmlspecialchars_decode($order['address'], ENT_QUOTES), 'buytime' => $order['time'], 'orderid' => $order['orderid'], 'sendtime' => $order['reservetime'] > 0 ? $order['reservetime'] : '尽快送达', 'price' => $order['price'], 'total' => $order['total'], 'typename' => '外卖', 'ptype' => $order['paytype'], 'list' => $temp);
$msg = ArrayToStr::array_to_str($msg, $order['paid']);
$op->printit($token, $order['cid'], 'DishOut', $msg, $order['paid']);
}
header('Location:' . U('DishOut/myOrder', array('token' => $token, 'wecha_id' => $wecha_id, 'cid' => $order['cid'])));
} else {
exit('抱歉,订单信息出错');
}
}
开发者ID:liuguogen,项目名称:weixin,代码行数:58,代码来源:ThirdPayDishOut.class.php
示例18: index
public function index($orderid, $paytype = '', $third_id = '')
{
if ($order = M('Product_cart')->where(array('orderid' => $orderid))->find()) {
//TODO 发货的短信提醒
if ($order['paid']) {
$userInfo = D('Userinfo')->where(array('token' => $order['token'], 'wecha_id' => $order['wecha_id']))->find();
$carts = unserialize($order['info']);
$tdata = self::getCat($carts, $order['token'], $order['cid'], $userInfo['getcardtime']);
$list = array();
$info = '';
$pre = '';
foreach ($tdata[0] as $va) {
$t = array();
$salecount = 0;
if (!empty($va['detail'])) {
foreach ($va['detail'] as $v) {
$t = array('num' => $v['count'], 'colorName' => $v['colorName'], 'formatName' => $v['formatName'], 'price' => $v['price'], 'name' => $va['name']);
$list[] = $t;
$salecount += $v['count'];
}
} else {
$t = array('num' => $va['count'], 'price' => $va['price'], 'name' => $va['name']);
$list[] = $t;
$salecount = $va['count'];
}
$info .= $pre . $va['name'];
$pre = ',';
D("Product")->where(array('id' => $va['id']))->setInc('salecount', $salecount);
}
if ($order['twid']) {
if ($set = M("Twitter_set")->where(array('token' => $order['token'], 'cid' => $order['cid']))->find()) {
$price = $set['percent'] * 0.01 * $order['totalprice'];
$info = $info ? '购买' . $info . '等产品,订单号:' . $orderid : '购买订单号:' . $orderid;
D("Twitter_log")->add(array('token' => $order['token'], 'cid' => $order['cid'], 'twid' => $order['twid'], 'type' => 3, 'dateline' => time(), 'param' => $order['totalprice'], 'price' => $price, 'wecha_id' => $order['wecha_id'], 'info' => $info));
if ($count = M("Twitter_count")->where(array('token' => $order['token'], 'cid' => $order['cid'], 'twid' => $order['twid']))->find()) {
D("Twitter_count")->where(array('id' => $count['id']))->setInc('total', $price);
} else {
D("Twitter_count")->add(array('token' => $order['token'], 'cid' => $order['cid'], 'twid' => $order['twid'], 'total' => $price, 'remove' => 0));
}
}
}
$company = D('Company')->where(array('token' => $order['token'], 'id' => $order['cid']))->find();
$op = new orderPrint();
$msg = array('companyname' => $company['name'], 'companytel' => $company['tel'], 'truename' => $order['truename'], 'tel' => $order['tel'], 'address' => $order['address'], 'buytime' => $order['time'], 'orderid' => $order['orderid'], 'sendtime' => '', 'price' => $order['price'], 'total' => $order['total'], 'list' => $list);
$msg = ArrayToStr::array_to_str($msg, 1);
$op->printit($order['token'], $order['cid'], 'Store', $msg, 1);
$userInfo = D('Userinfo')->where(array('token' => $order['token'], 'wecha_id' => $order['wecha_id']))->find();
Sms::sendSms($order['token'], "您的顾客{$userInfo['truename']}刚刚对订单号:{$orderid}的订单进行了支付,请您注意查看并处理");
$model = new templateNews();
$model->sendTempMsg('OPENTM202521011', array('href' => U('Store/my', array('token' => $order['token'], 'wecha_id' => $order['wecha_id'], 'twid' => $order['twid']), true, false, true), 'wecha_id' => $order['wecha_id'], 'first' => '购买商品提醒', 'keyword1' => $orderid, 'keyword2' => date("Y年m月d日H时i分s秒"), 'remark' => '购买成功,感谢您的光临,欢迎下次再次光临!'));
}
header('Location:/index.php?g=Wap&m=Store&a=my&token=' . $order['token'] . '&wecha_id=' . $order['wecha_id'] . '&twid=' . $order['twid']);
} else {
exit('订单不存在:' . $out_trade_no);
exit('订单不存在');
}
}
开发者ID:liuguogen,项目名称:weixin,代码行数:57,代码来源:ThirdPayStore.class.php
示例19: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
Sms::create(['provider_id' => '1', 'name' => 'auth_key']);
Sms::create(['provider_id' => '1', 'name' => 'sender_id']);
Sms::create(['provider_id' => '1', 'name' => 'route']);
Provider::create(array('name' => 'Msg91.com'));
// $this->call("OthersTableSeeder");
}
开发者ID:vijaysebastian,项目名称:sms,代码行数:14,代码来源:FaveoSmsDatabaseSeeder.php
示例20: handle
public static function handle($task)
{
echo '<pre>';
echo date('Y-m-d H:i:s') . ' handle task: ' . $task;
echo "\r\n";
switch ($task) {
case 'sms':
Sms::model()->send();
break;
}
}
开发者ID:zt123,项目名称:Base-System,代码行数:11,代码来源:Task.php
注:本文中的Sms类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论