function useredit() { $this->checkshoplogin(); $shopid = ICookie::get('adminshopid'); if ($shopid > 0) { $data['shopname'] = IFilter::act(IReq::get('shopname')); if (!empty($data['shopname'])) { $data['phone'] = IFilter::act(IReq::get('phone')); $data['address'] = IFilter::act(IReq::get('address')); $data['shortname'] = IFilter::act(IReq::get('shortname')); $data['email'] = IFilter::act(IReq::get('email')); $data['is_open'] = intval(IReq::get('is_open')); $starttime = IFilter::act(IReq::get('starttime')); $data['otherlink'] = IFilter::act(IReq::get('otherlink')); $data['IMEI'] = IFilter::act(IReq::get('IMEI')); $link = IUrl::creatUrl('shopcenter/base'); if (!IValidate::len($data['shopname'], 4, 50)) { $this->message('店铺名长度大于4小于50'); } //$this->refunction('店铺名长度大于4小于50',$link); if (!IValidate::phone($data['phone'])) { $this->message('正录入正确的订餐电话'); } //$this->refunction('正录入正确的订餐电话',$link); if (!IValidate::len($data['address'], 4, 50)) { $this->message('店铺门市地址长度大于4小于50'); } //$this->refunction('店铺门市地址长度大于4小于50',$link); if (!IValidate::len($data['shortname'], 3, 10)) { $this->message('访问地址长度大于3小于10'); } //$this->refunction('访问地址长度大于3小于10',$link); if (!empty($data['shortname'])) { if (!IValidate::email($data['email'])) { $this->message('邮箱地址不是邮件'); } //$this->refunction('邮箱地址不是邮件',$link); } if (in_array($data['shortname'], array('shopcenter', 'site', 'admin', 'member', 'membercenter', 'shop', 'comment', 'ask', 'single', 'gift', 'news', 'adv'))) { $this->message('访问地址已存在'); } // $this->refunction('访问地址已存在',$link); //判断是否是系统设置的类型 $checkcode = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "shop where id !='" . $shopid . "' and shortname ='" . $data['shortname'] . "' "); if (!empty($checkcode)) { $this->message('访问地址已存在'); } //$this->refunction('访问地址已存在',$link); //判断是否是有店铺 有此名称 $data['starttime'] = ''; if (empty($starttime)) { $this->message('录入时间不能为空'); } $starttime = explode(',', $starttime); if (!is_array($starttime)) { $this->message('时间格式错误'); } // $this->refunction('请录入正确时间格式',$link); $checkshu = count($starttime); if ($checkshu % 4 != 0) { $this->message('时间格式错误11'); } $newtime = array(); foreach ($starttime as $key => $value) { if ($key % 4 == 0) { $data['starttime'] .= $value . ':'; } elseif ($key % 4 == 1) { $data['starttime'] .= $value . '-'; } elseif ($key % 4 == 2) { $data['starttime'] .= $value . ':'; } elseif ($key % 4 == 3) { $data['starttime'] .= $value . '|'; } } if (empty($data['starttime'])) { $this->message('请录入营业时间'); } // $this->refunction('请录入营业时间',$link); if (count($newtime) % 2 == 1) { $this->message('请录入正确时间格式'); } //$this->refunction('请录入正确时间格式',$link); $data['starttime'] = substr($data['starttime'], 0, strlen($data['starttime']) - 1); $this->mysql->update(Mysite::$app->config['tablepre'] . 'shop', $data, "id='" . $shopid . "'"); //$basearea = $this->mysql->getarr("select * from ".Mysite::$app->config['tablepre']."areatowait where shopid=".$shopid." order by id desc limit 0,1000"); //更新店铺名称 $Searchk = new searchkey($this->mysql); $checkiex = $this->mysql->counts("select * from " . Mysite::$app->config['tablepre'] . "shopfast where shopid ='" . $shopid . "' "); if ($checkiex > 0) { $Searchk->setdata(1, $shopid, $data['shopname']); $Searchk->save(); } $this->success('操作成功'); } } $data['newtimedata'] = array(); Mysite::$app->setdata($data); }
function findpwd($uname) { if (!IValidate::email($uname)) { $this->error = '邮箱格式错误'; return false; } $memberinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "member where email='" . $uname . "' "); if (empty($memberinfo)) { $this->error = '获取邮箱帐号失败'; return false; } $title = '找回' . Mysite::$app->config['sitename'] . '帐号密码'; $sign = $this->mymd5($memberinfo['password'], $memberinfo['username']); $emaildata['findpwdurl'] = IUrl::creatUrl("member/resetpwd/uid/" . $memberinfo['uid'] . "/username/" . urlencode($memberinfo['username']) . "/sign/" . $sign); $default_tpl = new config('tplset.php', hopedir); $tpllist = $default_tpl->getInfo(); if (!isset($tpllist['emailfindtpl']) || empty($tpllist['emailfindtpl'])) { $this->error = '管理员未设置邮箱发送信息,请联系客服'; return false; } $emaildata['username'] = $memberinfo['username']; $emaildata['email'] = $memberinfo['email']; $emaildata['sitename'] = Mysite::$app->config['sitename']; $emaildata['siteurl'] = Mysite::$app->config['siteurl']; $smtp = new ISmtp(Mysite::$app->config['smpt'], 25, Mysite::$app->config['emailname'], Mysite::$app->config['emailpwd'], false); $content = Mysite::$app->statichtml($tpllist['emailfindtpl'], $emaildata); $info = $smtp->send($memberinfo['email'], Mysite::$app->config['emailname'], $title, $content, "", "HTML", "", ""); return true; }
function starttask() { $taskid = IReq::get('taskid'); $taskinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "task where id='" . $taskid . "' "); if (empty($taskinfo)) { echo '任务不存在'; exit; } if ($taskinfo['status'] > 1) { echo '任务执行完毕,请关闭窗口'; exit; } $data = array('taskmiaoshu' => ''); //执行任务 if ($taskinfo['tasktype'] == 1) { $emailids = ''; //邮箱ID集 $newdata = array(); //任务处理数据 $data['taskmiaoshu'] .= '邮件群发任务'; if ($taskinfo['taskusertype'] == 1) { // echo '根据用户表筛选查询'.$taskinfo['tasklimit'];//tasklimit //构造默认查询 $where = ' where uid > ' . $taskinfo['start_id'] . ' ' . $taskinfo['tasklimit']; //start_id;//起点UID $memberlist = $this->mysql->getarr("select * from " . Mysite::$app->config['tablepre'] . "member " . $where . " order by uid asc limit 0, 10"); $startid = $taskinfo['start_id']; if (count($memberlist) > 9) { foreach ($memberlist as $key => $value) { if (IValidate::email($value['email'])) { $emailids .= empty($emailids) ? $value['email'] : ',' . $value['email']; } $startid = $value['uid']; } } if (count($memberlist) < 10) { //更新任务执行完毕 $newdata['status'] = 2; $data['taskmiaoshu'] .= ',执行完毕'; } else { // $newdata['status'] = 1; $newdata['start_id'] = $startid; //更新下一页 $data['taskmiaoshu'] .= ',从用户表uid为' . $taskinfo['start_id'] . '执行到uid为' . $startid; } //更新任务 } else { $tasklimit = $taskinfo['tasklimit']; $checklist = explode(',', $tasklimit); foreach ($checklist as $key => $value) { if (IValidate::email($value)) { $emailids .= empty($emailids) ? $value : ',' . $value; } } $newdata['status'] = 2; //更新任务 $data['taskmiaoshu'] .= ',根据指定邮箱地址发送邮件完成'; } //更新任务 $this->mysql->update(Mysite::$app->config['tablepre'] . 'task', $newdata, "id='" . $taskid . "'"); if (!empty($emailids)) { $smtp = new ISmtp(Mysite::$app->config['smpt'], 25, Mysite::$app->config['emailname'], Mysite::$app->config['emailpwd'], false); //$content = iconv('utf-8','gb2312',$content); $info = $smtp->send($emailids, Mysite::$app->config['emailname'], $taskinfo['taskname'], $taskinfo['content'], "", "HTML", "", ""); } $data['taskdata'] = $newdata; $data['showcontent'] = $emailids; } else { $emailids = ''; //邮箱ID集 $newdata = array(); //任务处理数据 $data['taskmiaoshu'] .= '短信群发任务'; if ($taskinfo['taskusertype'] == 1) { // echo '根据用户表筛选查询'.$taskinfo['tasklimit'];//tasklimit //构造默认查询 $where = ' where uid > ' . $taskinfo['start_id'] . ' ' . $taskinfo['tasklimit']; //start_id;//起点UID $memberlist = $this->mysql->getarr("select * from " . Mysite::$app->config['tablepre'] . "member " . $where . " order by uid asc limit 0, 10"); $startid = $taskinfo['start_id']; if (count($memberlist) > 9) { foreach ($memberlist as $key => $value) { if (IValidate::suremobi($value['phone'])) { $emailids .= empty($emailids) ? $value['phone'] : ',' . $value['phone']; } $startid = $value['uid']; } } if (count($memberlist) < 10) { //更新任务执行完毕 $newdata['status'] = 2; $data['taskmiaoshu'] .= ',执行完毕'; } else { // $newdata['status'] = 1; $newdata['start_id'] = $startid; //更新下一页 $data['taskmiaoshu'] .= ',从用户表uid为' . $taskinfo['start_id'] . '执行到uid为' . $startid; } //更新任务 } else { $tasklimit = $taskinfo['tasklimit']; $checklist = explode(',', $tasklimit); foreach ($checklist as $key => $value) { if (IValidate::suremobi($value)) { $emailids .= empty($emailids) ? $value : ',' . $value; } } $newdata['status'] = 2; //更新任务 $data['taskmiaoshu'] .= ',根据指定手机号发送短信完成'; } //更新任务 $data['showcontent'] = $emailids; if (!empty($emailids)) { $sendmobile = new mobile(); /* $checklogin = $sendmobile->login(); if($checklogin == 'ok') { */ $emailids = explode(',', $emailids); $chekcinfo = $sendmobile->sendsms($emailids, $taskinfo['content']); if ($chekcinfo == 'ok') { //发送成功 //更新任务 $this->mysql->update(Mysite::$app->config['tablepre'] . 'task', $newdata, "id='" . $taskid . "'"); } else { $data['taskmiaoshu'] .= ',短信发送失败,错误代码:' . $chekcinfo; } /* $sendmobile->endsend(); }else{ $data['taskmiaoshu'] .= ',短信发送失败,错误代码:'.$checklogin; } */ } $data['taskdata'] = $newdata; } Mysite::$app->setdata($data); }
/** * @brief 发送验证邮箱邮件 */ public function send_check_mail() { $email = IReq::get('email'); if (IValidate::email($email) == false) { IError::show(403, '邮件格式错误'); } $userDB = new IModel('user'); $userRow = $userDB->getObj('email = "' . $email . '"'); $code = base64_encode($userRow['email'] . "|" . $userRow['id']); $url = IUrl::getHost() . IUrl::creatUrl("/simple/check_mail/code/{$code}"); $content = mailTemplate::checkMail(array("{url}" => $url)); //发送邮件 $smtp = new SendMail(); $result = $smtp->send($email, "用户注册邮箱验证", $content); if ($result === false) { IError::show(403, "发信失败,请重试!或者联系管理员查看邮件服务是否开启"); } $message = "您的邮箱验证邮件已发送到{$email}!请到您的邮箱中去激活"; $this->redirect('/site/success?message=' . urlencode($message) . '&email=' . $email); }
function email_registry() { $email = IReq::get('email'); $result = array('isError' => true); if (!IValidate::email($email)) { $result['message'] = '请填写正确的email地址'; } else { $emailRegObj = new IModel('email_registry'); $emailRow = $emailRegObj->getObj('email = "' . $email . '"'); if (!empty($emailRow)) { $result['message'] = '此email已经订阅过了'; } else { $dataArray = array('email' => $email); $emailRegObj->setData($dataArray); $status = $emailRegObj->add(); if ($status == true) { $result = array('isError' => false, 'message' => '订阅成功'); } else { $result['message'] = '订阅失败'; } } } echo JSON::encode($result); }
public function bind_nexists_user() { $username = IFilter::act(IReq::get('username')); $email = IFilter::act(IReq::get('email')); $oauth_id = IFilter::act(ISession::get('oauth_id')); $oauth_userInfo = IFilter::act(ISession::get('oauth_userInfo')); /*注册信息校验*/ if (IValidate::email($email) == false) { $message = '邮箱格式不正确'; } else { if (!Util::is_username($username)) { $message = '用户名必须是由2-20个字符,可以为字数,数字下划线和中文'; } else { $userObj = new IModel('user'); $where = 'email = "' . $email . '" or username = "******" or username = "******"'; $userRow = $userObj->getObj($where); if (!empty($userRow)) { if ($email == $userRow['email']) { $message = '此邮箱已经被注册过,请重新更换'; } else { $message = "此用户名已经被注册过,请重新更换"; } } else { $userData = array('email' => $email, 'username' => $username, 'password' => md5(ITime::getDateTime())); $userObj->setData($userData); $user_id = $userObj->add(); $memberObj = new IModel('member'); $memberData = array('user_id' => $user_id, 'true_name' => $oauth_userInfo['name'], 'last_login' => ITime::getDateTime(), 'sex' => isset($oauth_userInfo['sex']) ? $oauth_userInfo['sex'] : 1, 'time' => ITime::getDateTime()); $memberObj->setData($memberData); $memberObj->add(); $oauthUserObj = new IModel('oauth_user'); //插入关系表 $oauthUserData = array('oauth_user_id' => $oauth_userInfo['id'], 'oauth_id' => $oauth_id, 'user_id' => $user_id, 'datetime' => ITime::getDateTime()); $oauthUserObj->setData($oauthUserData); $oauthUserObj->add(); $userRow = $userObj->getObj('id = ' . $user_id); $this->loginAfter($userRow); //自定义跳转页面 $callback = ISafe::get('callback'); $this->redirect('/simple/success_info/?callback=' . $callback); } } } if ($message != '') { $this->message = $message; $this->redirect('bind_user', false); } }
function regesteremail() { $regestercode = Mysite::$app->config['regestercode']; $checkcode = ICookie::get('regemailcode'); $checkphone = ICookie::get('regemail'); $checktime = ICookie::get('regtime'); if (empty($regestercode)) { echo 'noshow(\'不需要验证CODE\')'; exit; } if (!empty($checkcode)) { $backtime = $checktime - time(); if ($backtime > 0) { echo 'showsendemail(\'' . $checkphone . '\',' . $backtime . ')'; exit; } } if (!empty($this->member['uid'])) { echo 'noshow(\'已登陆\')'; exit; } $email = IFilter::act(IReq::get('email')); if (!IValidate::email($email)) { echo ''; exit; } $userinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "member where email='" . $email . "' "); if (!empty($userinfo)) { echo 'noshow(\'邮箱已注册\')'; exit; } $makecode = mt_rand(10000, 99999); $title = Mysite::$app->config['sitename'] . '注册验证码'; $smtp = new ISmtp(Mysite::$app->config['smpt'], 25, Mysite::$app->config['emailname'], Mysite::$app->config['emailpwd'], false); $content = '欢迎注册' . Mysite::$app->config['sitename'] . '会员,注册验证码为:' . $makecode; $info = $smtp->send($email, Mysite::$app->config['emailname'], $title, $content, "", "HTML", "", ""); ICookie::set('regemailcode', $makecode, 600); ICookie::set('regemail', $email, 600); $longtime = time() + 60; ICookie::set('regtime', $longtime, 60); echo 'showsendemail(\'' . $email . '\',60)'; exit; }
function sendmess($orderid) { $smtp = new ISmtp(Mysite::$app->config['smpt'], 25, Mysite::$app->config['emailname'], Mysite::$app->config['emailpwd'], false); $sendmobile = new mobile(); $wx_s = new wx_s(); $orderinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "order where id= '" . $orderid . "' "); $orderdet = $this->mysql->getarr("select * from " . Mysite::$app->config['tablepre'] . "orderdet where order_id= '" . $orderid . "' "); $shopinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "shop where id= '" . $orderinfo['shopid'] . "' "); $tempdata = array('orderinfo' => $orderinfo, 'orderdet' => $orderdet, 'sitename' => Mysite::$app->config['sitename']); $contents = ''; $checknotice = isset($shopinfo['noticetype']) ? explode(',', $shopinfo['noticetype']) : array(); $contents = ''; $appcheck = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "applogin where uid = '" . $orderinfo['shopuid'] . "' "); if (!empty($appcheck)) { /* $appCls = new appclass(); $backinfo = $appCls->sendmsg($appcheck['userid'],$appcheck['channelid'],Mysite::$app->config['sitename'].'订单提醒','您有新的订单,单号:'.$orderinfo['dno'],$messagetype=1); logwrite('APP发送:'.$backinfo);*/ } if (in_array(1, $checknotice)) { if (Mysite::$app->config['allowedsendshop'] == 1) { if (IValidate::suremobi($orderinfo['shopphone'])) { $default_tpl = new config('tplset.php', hopedir); $tpllist = $default_tpl->getInfo(); if (!isset($tpllist['shopphonetpl']) || empty($tpllist['shopphonetpl'])) { // logwrite('短信发送商家模板加载失败'); } else { $contents = Mysite::$app->statichtml($tpllist['shopphonetpl'], $tempdata); if (Mysite::$app->config['smstype'] == 2) { //139邮箱转发短信 //使用sms10086cn发送/ $APIServer = 'http://www.sms-10086.cn/Service.asmx/sendsms?'; $weblink = $APIServer . 'zh=' . trim(Mysite::$app->config['sms86ac']) . '&mm=' . trim(Mysite::$app->config['sms86pd']) . '&hm=' . $orderinfo['shopphone'] . '&nr=' . urlencode($contents) . '&dxlbid=27'; $contentcccc = file_get_contents($weblink); logwrite('短信sms10086cn发送结果:' . $contentcccc); } else { //使用sms10086cn发送/ $phoneids = array(); $phoneids[] = $orderinfo['shopphone']; $chekcinfo = $sendmobile->sendsms($phoneids, $contents); logwrite('亿美短信接口发送结果:' . $chekcinfo); } } } else { logwrite('短信发送商家' . $shopinfo['shopname'] . '联系电话错误'); } } } if (in_array(3, $checknotice)) { $wechat = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "shop_wechat where shopid=" . $orderinfo['shopid']); $wx_s = array(); if (!empty($wechat)) { $wx_s = new wx_s($wechat['token'], $wechat['appid'], $wechat['secret'], $orderinfo['shopid']); } if (!empty($orderinfo['shopuid']) && !empty($wechat)) { $wechat = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "shop_wechat where shopid=" . $orderinfo['shopid']); //if (!empty($wechat)) { //$wx_s = new wx_s($wechat['token'], $wechat['appid'], $wechat['secret'],$orderinfo['shopid']); //找到要发送的商户微信openid $openid_list = $this->mysql->getarr("select openid from " . Mysite::$app->config['tablepre'] . "shop_wxuser where shopid=" . $orderinfo['shopid'] . " and is_merchant=1"); $payarrr = array('outpay' => '到付', 'open_acout' => '余额支付'); $orderpastatus = $orderinfo['paystatus'] == 1 ? '已支付' : '未支付'; $orderpaytype = isset($payarrr[$orderinfo['paytype']]) ? $payarrr[$orderinfo['paytype']] : '在线支付'; $tempdata = array('orderinfo' => $orderinfo, 'orderdet' => $orderdet, 'sitename' => Mysite::$app->config['sitename']); $temp_content = $orderinfo['buyername'] . '在' . Mysite::$app->config['sitename'] . '下单成功' . '\\n'; $temp_content .= '下单时间:' . date('m-d H:i', $orderinfo['addtime']) . '\\n'; $temp_content .= '配送时间:' . date('m-d H:i', $orderinfo['posttime']) . '\\n'; $temp_content .= '支付方式' . $orderpaytype . ',' . $orderpastatus . ' ' . '\\n'; $temp_content .= '收货人:' . $orderinfo['buyername'] . '\\n'; $temp_content .= '地址:' . $orderinfo['buyeraddress'] . '\\n'; $temp_content .= '联系电话:' . $orderinfo['buyerphone'] . '\\n'; $temp_content .= '单号:' . $orderinfo['dno'] . '\\n'; $temp_content .= '总价:' . $orderinfo['allcost'] . '元,配送费:' . $orderinfo['shopps'] . '元\\n'; $temp_content .= '备注:' . $orderinfo['content'] . '\\n'; foreach ($orderdet as $km => $vc) { $temp_content .= $vc['goodsname'] . '(' . $vc['goodscount'] . '份)\\n'; } if (!empty($openid_list)) { if (!empty($temp_content)) { foreach ($openid_list as $key => $value) { if ($wx_s->sendmsg($temp_content, $value['openid'])) { } else { logwrite('微信客服发送错误:' . $wx_s->err()); } } } } //} //$wxshop = $this->mysql->select_one("select * from ".Mysite::$app->config['tablepre']."wxuser where uid= '".$orderinfo['shopuid']."' "); /*if(!empty($wxshop)){ $payarrr = array('outpay'=>'到付','open_acout'=>'余额支付'); $orderpastatus = $orderinfo['paystatus'] == 1?'已支付':'未支付'; $orderpaytype = isset($payarrr[$orderinfo['paytype']])?$payarrr[$orderinfo['paytype']]:'在线支付'; $tempdata = array('orderinfo'=>$orderinfo,'orderdet'=>$orderdet,'sitename'=>Mysite::$app->config['sitename']); $temp_content = $orderinfo['buyername'].'在'.Mysite::$app->config['sitename'].'下单成功'.'\n'; $temp_content .='下单时间:'.date('m-d H:i',$orderinfo['addtime']).'\n'; $temp_content .='配送时间:'.date('m-d H:i',$orderinfo['posttime']).'\n'; $temp_content .='支付方式'.$orderpaytype.','.$orderpastatus.' '.'\n'; $temp_content .='收货人:'.$orderinfo['buyername'].'\n'; $temp_content .='地址:'.$orderinfo['buyeraddress'].'\n'; $temp_content .='联系电话:'.$orderinfo['buyerphone'].'\n'; $temp_content .='单号:'.$orderinfo['dno'].'\n'; $temp_content .='总价:'.$orderinfo['allcost'].'元,配送费:'.$orderinfo['shopps'].'元\n'; $temp_content .='备注:'.$orderinfo['content'].'\n'; foreach($orderdet as $km=>$vc){ $temp_content .=$vc['goodsname'].'('.$vc['goodscount'].'份)\n'; } //增加超连接 $time = time(); $tempstr = md5(Mysite::$app->config['wxtoken'].$time); $tempstr = substr($tempstr,3,15); $dolink = Mysite::$app->config['siteurl'].'/index.php?controller=wxsite&action=shopshoworder&id='.$orderinfo['id']; $backinfo = ''; if(!empty($dolink)){ $templink = $dolink; for($i=0;$i<strlen($templink);$i++){ $backinfo .= ord($templink[$i]).','; } } $linkstr = Mysite::$app->config['siteurl'].'/index.php?controller=wxsite&action=index&openid='.$wxshop['openid'].'&actime='.$time.'&sign='.$tempstr.'&backinfo='.$backinfo; $temp_content .= '<a href=\''.trim($linkstr).'\'>查看详情</a>'; if(!empty($temp_content)){ $wx_s = new wx_s($wechat['token'], $wechat['appid'], $wechat['secret'],$orderinfo['shopid']); if($wx_s->sendmsg($temp_content,$wxshop['openid'])){ }else{ logwrite('微信客服发送错误:'.$wx_s->err()); } } }*/ } if (!empty($orderinfo['buyeruid']) && !empty($wechat)) { //2015-06-25查不到$shopid把$shopid改成$shopinfo['id'] $wxbuyer = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "shop_wxuser where shopid='" . $shopinfo['id'] . "' and uid= '" . $orderinfo['buyeruid'] . "' "); if (!empty($wxbuyer)) { if (empty($contents)) { $default_tpl = new config('tplset.php', hopedir); $tpllist = $default_tpl->getInfo(); if (!isset($tpllist['shopphonetpl']) || empty($tpllist['shopphonetpl'])) { } else { $contents = Mysite::$app->statichtml($tpllist['userbuytpl'], $tempdata); } } if (!empty($contents)) { /*$time = time(); $tempstr = md5(Mysite::$app->config['wxtoken'].$time); $tempstr = substr($tempstr,3,15); $dolink = Mysite::$app->config['siteurl'].'/index.php?controller=wxsite&action=ordershow&orderid='.$orderinfo['id']; $backinfo = ''; if(!empty($dolink)){ $templink = $dolink; for($i=0;$i<strlen($templink);$i++){ $backinfo .= ord($templink[$i]).','; } } // $backinfo = str_replace(array('"',',','&'),array('-','^','@'),json_encode($dolink)); //shopshoworder $linkstr = Mysite::$app->config['siteurl'].'/index.php?controller=wxsite&action=index&openid='.$wxbuyer['openid'].'&actime='.$time.'&sign='.$tempstr.'&backinfo='.$backinfo; $contents .= '<a href=\''.trim($linkstr).'\'>查看详情</a>';*/ if ($wx_s->sendmsg($contents, $wxbuyer['openid'])) { } else { logwrite('微信客服发送错误:' . $wx_s->err()); } } } } } if (!empty($shopinfo['machine_code']) && !empty($shopinfo['mKey'])) { $payarrr = array('outpay' => '到付', 'open_acout' => '余额支付'); $orderpastatus = $orderinfo['paystatus'] == 1 ? '已支付' : '未支付'; $orderpaytype = isset($payarrr[$orderinfo['paytype']]) ? $payarrr[$orderinfo['paytype']] : '在线支付'; $temp_content = ''; foreach ($orderdet as $km => $vc) { $temp_content .= $vc['goodsname'] . '(' . $vc['goodscount'] . '份) \\n '; } $msg = '商家:' . $shopinfo['shopname'] . ' 订餐热线:' . Mysite::$app->config['litel'] . ' 订单状态:' . $orderpaytype . ',(' . $orderpastatus . ') 姓名:' . $orderinfo['buyername'] . ' 电话:' . $orderinfo['buyerphone'] . ' 地址:' . $orderinfo['buyeraddress'] . ' 下单时间:' . date('m-d H:i', $orderinfo['addtime']) . ' 配送时间:' . date('m-d H:i', $orderinfo['posttime']) . ' ******************************* ' . $temp_content . ' ******************************* 配送费:' . $orderinfo['shopps'] . '元 合计:' . $orderinfo['allcost'] . '元 ※※※※※※※※※※※※※※ 谢谢惠顾,欢迎下次光临 订单编号' . $orderinfo['dno'] . ' 备注' . $orderinfo['content'] . ' '; $this->dosengprint($msg, $shopinfo['machine_code'], $shopinfo['mKey']); } if (in_array(2, $checknotice)) { //同时使用邮件通知 if (Mysite::$app->config['noticeshopemail'] == 1) { //同时使用邮件通知 if (IValidate::email($shopinfo['email'])) { $default_tpl = new config('tplset.php', hopedir); $tpllist = $default_tpl->getInfo(); if (!isset($tpllist['emailorder']) || empty($tpllist['emailorder'])) { logwrite('邮件发送商家模板加载失败'); } else { //surelink //算方计算 $time = time(); $tempstr = md5($orderinfo['dno'] . $time); $tempstr = substr($tempstr, 3, 15); $tempstr = md5($orderinfo['shopuid'] . $tempstr); $tempstr = substr($tempstr, 3, 15); $tempdata['surelink'] = Mysite::$app->config['siteurl'] . '/index.php?controller=site&action=makeshow&id=' . $orderinfo['id'] . '&actime=' . $time . '&sign=' . $tempstr . '&status=1'; $tempdata['closelink'] = Mysite::$app->config['siteurl'] . '/index.php?controller=site&action=makeshow&id=' . $orderinfo['id'] . '&actime=' . $time . '&sign=' . $tempstr . '&status=2'; $emailcontent = Mysite::$app->statichtml($tpllist['emailorder'], $tempdata); $title = '您有一笔' . Mysite::$app->config['sitename'] . '新订单,请尽快处理'; $info = $smtp->send($shopinfo['email'], Mysite::$app->config['emailname'], $title, $emailcontent, "", "HTML", "", ""); } } else { logwrite('商家' . $shopinfo['shopname'] . '邮箱地址' . $shopinfo['shopemail'] . '错误'); } } } $contents = ''; if (Mysite::$app->config['allowedsendbuyer'] == 1) { if (IValidate::suremobi($orderinfo['buyerphone'])) { $default_tpl = new config('tplset.php', hopedir); $tpllist = $default_tpl->getInfo(); if (!isset($tpllist['userbuytpl']) || empty($tpllist['userbuytpl'])) { logwrite('短信发送会员模版失败'); } else { $contents = Mysite::$app->statichtml($tpllist['userbuytpl'], $tempdata); if (Mysite::$app->config['smstype'] == 2) { //139邮箱转发短信 //使用sms10086cn发送 $APIServer = 'http://www.sms-10086.cn/Service.asmx/sendsms?'; $weblink = $APIServer . 'zh=' . trim(Mysite::$app->config['sms86ac']) . '&mm=' . trim(Mysite::$app->config['sms86pd']) . '&hm=' . $orderinfo['buyerphone'] . '&nr=' . urlencode($contents) . '&dxlbid=27'; $contentcccc = file_get_contents($weblink); logwrite('短信sms10086cn发送结果:' . $contentcccc); } else { //使用sms10086cn发送 $phoneids = array(); $phoneids[] = $orderinfo['buyerphone']; $chekcinfo = $sendmobile->sendsms($phoneids, $contents); logwrite('亿美短信接口发送结果:' . $chekcinfo); } logwrite($contents); } } } }
public function savemember() { $this->checkadminlogin(); $uid = intval(IReq::get('uid')); $data['username'] = IReq::get('username'); $data['password'] = IReq::get('password'); $data['phone'] = IReq::get('phone'); $data['address'] = IReq::get('address'); $data['email'] = IReq::get('email'); $data['group'] = IReq::get('group'); $data['score'] = IReq::get('score'); $data['cost'] = IReq::get('cost'); if (!IValidate::email($data['email'])) { $this->message('邮箱格式错误! [好资源www.mx800.com]'); } if (!IValidate::phone($data['phone'])) { $this->message('联系电话格式错误! [好资源www.mx800.com]'); } if (empty($data['username'])) { $this->message('用户名不能为空 [好资源www.mx800.com]'); } if (empty($uid)) { if ($this->memberCls->regester($data['email'], $data['username'], $data['password'], $data['phone'], $data['group'], '', '', $data['cost'], $data['score'])) { $this->success('操作成功!'); } else { $this->message($this->memberCls->ero()); } } else { if ($this->memberCls->modify($data, $uid)) { $this->success('操作成功!'); } else { $this->message($this->memberCls->ero()); } } $this->success('操作成功!'); }