Beispiel #1
0
function sendnewleer()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'");
    //$pic_total = $_MooClass['MooMySQL']->numRows($query);
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        MooMessage('自己不可以给自己发过送秋波', 'javascript:history.go(-1);', '04');
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,送秋波失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('同性之间不可互发秋波', 'javascript:history.go(-1);', '02');
        exit;
    }
    //测试用的 by hwt
    if ($_POST['sendleer']) {
        if (empty($GLOBALS['MooUid'])) {
            list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
            $uid = intval($uid);
        } else {
            $uid = $GLOBALS['MooUid'];
        }
        if (empty($uid)) {
            MooMessage('您还没有登录', 'index.php?n=login');
        }
        $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ");
        if ($leer['lid']) {
            $lid = $leer['lid'];
            //note 如果已经发送过秋波,就增加发送秋波的次数
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET num = num + 1,receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime = '{$timestamp}',receive_del = '0' WHERE lid = '{$lid}'");
            //note 如果已经收到这个人的秋波,已经拒绝,现在改变注意,又发送秋波给这个人,拒绝状态2更改为0
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '0' WHERE senduid = '{$sendtoid}' AND receiveuid = '{$uid}' AND stat = '2'");
        } else {
            //note 发送新的秋波,写入数据库 发送者,接受者,发送时间
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_leer SET sendtime = '{$timestamp}',receivetime = '{$timestamp}',receivenum = '1', num = '1', senduid  = '{$uid}',receiveuid = '{$sendtoid}'");
        }
        //将新注册的会员更新为优质会员
        if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
            update_iswell_user($user_arr['uid']);
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        if (MOOPHP_ALLOW_FASTDB) {
            $res = MooFastdbGet('members', 'uid', $sendtoid);
        } else {
            $res = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members where uid='{$sendtoid}'");
        }
        $send_user_info = $_MooClass['MooMySQL']->getOne("select * from `{$dbTablePre}members` a  left join  {$dbTablePre}choice b  on a.uid=b.uid  where a.uid = '{$uid}' LIMIT 1");
        //头像路径
        $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name]);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $provice_list[$send_user_info[province]];
        //省
        $city = $city_list[$send_user_info[city]];
        //市
        $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知";
        //身高
        ob_start();
        //require_once MooTemplate('public/mail_space_leertpl', 'module'); //秋波模板
        require_once MooTemplate('public/mail_space_leertpl', 'module');
        //秋波模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
        // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce);
        //每天向同一用户发送多次,短信记录数表只记一次
        $send_leer_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
        //
        $today_leer_count = isset($leer['lid']) ? $leer['num'] + 1 : 1;
        if (date("Y-m-d") > $send_leer_date) {
            $today_leer_count = 1;
        }
        /*if($res['is_phone']){
            SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405");
          }*/
        //SendMsg($res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
        /*
                    $week_time = 24*3600*7;//一周时间秒数
                    $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
                    $date1 = date("Y-m-d",strtotime("last Monday"));
                    $date2 = date("Y-m-d",strtotime("Sunday"));
                    
                    if($interval_time > $week_time){//不活跃用户每周发一条短信
                            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
                            if($cos['c']<=1){
                                //fanglin暂时屏蔽
                              Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
                           }
                    }else{ //活跃用户每天一条
                         if($send_leer_date==date("Y-m-d") && $today_leer_count == 1){  //每天同一个用户发送多次秋波,短信只记一次
                           $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
                           if($cos[c]<5){
                              $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                              //fanglin暂时屏蔽
                              Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
                           }
                       }    
                    }*/
        //提醒所属客服
        $sid = $user_arr['sid'];
        $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了秋波';
        $awoketime = $timestamp + 3600;
        $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
        $res = $_MooClass['MooMySQL']->query($sql_remark);
        $users =& $res;
        MooMessage('发送秋波成功', 'index.php?n=service&h=leertest&t=sendnewleer');
    } else {
        $sql = "SELECT content  FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1";
        $sendinfo = $_MooClass['MooMySQL']->getAll($sql);
        require MooTemplate('public/service_leer_sendnewleer', 'module');
    }
}
Beispiel #2
0
function addmyfriend()
{
    global $_MooClass, $dbTablePre, $pagesize, $user_arr, $timestamp, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    if ($sendtoid == $userid) {
        MooMessage('自己不可加自己为意中人', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,加意中人失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'");
    //$pic_total = $_MooClass['MooMySQL']->numRows($query);
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('不可加同性为意中人', 'javascript:history.go(-1);', '04');
        exit;
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    if (empty($uid)) {
        MooMessage('您还没有登录', 'index.php?n=login', '04');
    }
    $friend = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$sendtoid}' AND uid = '{$uid}'", true);
    if ($friend['fid']) {
        $content = '对不起,对方已经在您的意中人列表中';
        $url = 'index.php?n=space&h=viewpro&uid=' . $sendtoid;
        MooMessage($content, $url, '02');
    } else {
        //note 加为意中人,新插入一行记录,谁加谁
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_friend SET friendid  = '{$sendtoid}',uid = '{$uid}',sendtime='" . time() . "'");
    }
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($uid);
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    if (MOOPHP_ALLOW_FASTDB) {
        $res = MooFastdbGet('members_search', 'uid', $sendtoid);
        $res_b = MooFastdbGet('members_base', 'uid', $sendtoid);
        $res = array_merge($res, $res_b);
    } else {
        $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where uid='{$sendtoid}'");
    }
    $send_user_info = $_MooClass['MooMySQL']->getAll("select c.*,b.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base b on a.uid=b.uid  left join  {$dbTablePre}choice c  on a.uid=c.uid  where a.uid = '{$uid}'");
    $send_user_info = $send_user_info[0];
    //头像路径
    $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $provice_list[$send_user_info[province]];
    //省
    $city = $city_list[$send_user_info[city]];
    //市
    $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知";
    //身高
    ob_start();
    require_once MooTemplate('public/mail_space_friendtpl', 'module');
    //模板
    $body = ob_get_clean();
    //	   MooSendMailSpace2($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员将您添加为意中人了!请尽快查收!您的帐号是:".$res['username'],$type="1",$body);
    MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce);
    $week_time = 24 * 3600 * 7;
    //一周时间秒数
    $interval_time = $timestamp - $user_arr['last_login_time'];
    //当前时间-最后登录时间
    $date1 = date("Y-m-d", strtotime("last Monday"));
    $date2 = date("Y-m-d", strtotime("Sunday"));
    if ($interval_time > $week_time) {
        //不活跃用户每周发一条短信
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sendtoid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
        $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sendtoid}'  and sendtime>='{$date1}' and sendtime<='{$date2}'");
        if ($cos[c] <= 1) {
            //fanglin暂时屏蔽
            Push_message_intab($sendtoid, $res['telphone'], "意中人", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已将您添加为意中人,请及时把握您的缘分!4006780405", $userid);
        }
    } else {
        //每天该用户超过5条信息不发送短信
        $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sendtoid}' and sendtime='" . date("Y-m-d") . "'");
        if ($cos[c] < 5) {
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sendtoid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            //fanglin暂时屏蔽
            Push_message_intab($sendtoid, $res['telphone'], "意中人", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已将您添加为意中人,请及时把握您的缘分!4006780405", $userid);
        }
    }
    require MooTemplate('public/service_friend_addmyfriend', 'module');
}
Beispiel #3
0
function send_rose()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    $query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $_MooClass['MooMySQL']->numRows($query);
    //note 自己不能给自己发送玫瑰,直接转到玫瑰列表页面
    if ($userid == $sendtoid) {
        MooMessage('自己不可以给自己送鲜花', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //客服不能模拟操作
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,送鲜花失败', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('不可给同性发送鲜花', 'javascript:history.go(-1);');
        exit;
    }
    //note 如果自己没有玫瑰花了,就提示没有玫瑰花了
    if ($user['rosenumber'] <= 0) {
        MooMessage('您没有鲜花了,获取更多鲜花', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    if (MOOPHP_ALLOW_FASTDB) {
        $res = MooFastdbGet('members_search', 'uid', $sendtoid);
        $res_b = MooFastdbGet('members_base', 'uid', $sendtoid);
        $res = array_merge($res, $res_b);
    } else {
        $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid  where s.uid='{$sendtoid}'");
    }
    $send_user_info = $_MooClass['MooMySQL']->getAll("select b.*,c.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base c on a.uid=c.uid  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '{$userid}'");
    $send_user_info = $send_user_info[0];
    //头像路径
    $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $provice_list[$send_user_info['province']];
    //省
    $city = $city_list[$send_user_info['city']];
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    require_once MooTemplate('public/mail_space_rosetpl', 'module');
    //模板
    $body = ob_get_clean();
    MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    if (empty($uid)) {
        MooMessage('您还没有登录', 'index.php?n=login');
    }
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    if ($user['rosenumber'] > 0) {
        if ($leer['rid']) {
            $rid = $leer['rid'];
            //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
        } else {
            //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
        }
        //note 发送一朵玫瑰,自己就要减少一朵玫瑰
        //enkytest
        //enkytestend
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
        if (MOOPHP_ALLOW_FASTDB) {
            $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1");
            $value['rosenumber'] = $user_rosenum['rosenumber'];
            MooFastdbUpdate('members_base', 'uid', $userid, $value);
        }
    }
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    if ($res['is_phone']) {
        SendMsg($res['telphone'], "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花,请及时把握您的缘分!4006780405");
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    MooMessage('发送鲜花成功' . $note, "index.php?n=service&h=rose&t=isendrose", "05");
    require MooTemplate('public/service_rose_sendrose', 'module');
}
Beispiel #4
0
function sendnewfl()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached, $_MooCookie, $GLOBALS;
    //是否合法登录
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer', 'P');
    //
    $user_arr = MooMembersData($userid);
    $uid = $userid;
    $return = array();
    $is_first_send = true;
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        $error = "自己不可以给自己发过送鲜花";
        echo return_data($error, false);
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        //只能模拟全权会员
        $error = "对不起您不能模拟操作";
        echo return_data($error, false);
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        $error = "因特殊原因,送鲜花失败";
        echo return_data($error, false);
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        $error = "同性之间不可互发鲜花";
        echo return_data($error, false);
        exit;
        exit;
    }
    if ($user['rosenumber'] <= 0) {
        $error = '您没有鲜花了,获取更多鲜花';
        echo return_data($error, false);
        exit;
    }
    //
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    $res = MooMembersData($sendtoid);
    $send_user_info = array_merge(MooGetData('members_choice', 'uid', $userid), MooMembersData($userid));
    //头像路径
    $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
    //省
    $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    //require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板
    $body = ob_get_clean();
    if ($res['usertype'] != 3) {
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    //if(empty($uid)){
    //	MooMessage('您还没有登录','index.php?n=login');
    //}
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    //库中验证鲜花数
    //$rosenum_check =  $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1",true);
    //if($rosenum_check['rosenumber'] > 0) {
    if ($leer['rid']) {
        $is_first_send = false;
        $rid = $leer['rid'];
        //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
    } else {
        //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
    }
    //note 发送一朵玫瑰,自己就要减少一朵玫瑰
    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
    if (MOOPHP_ALLOW_FASTDB) {
        $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1", true);
        $value['rosenumber'] = $user_rosenum['rosenumber'];
        MooFastdbUpdate('members_base', 'uid', $userid, $value);
    }
    //}
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    $sendinfo = MooGetGPC('sendinfo', 'string', 'G');
    if (!empty($sendinfo)) {
        $sendinfo = ",对您说:" . $sendinfo;
    }
    if ($res['usertype'] != 3) {
        if ($serverid) {
            //客服模拟会员登录可以选择发送短信或彩信
            $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'G');
            if ($SMStype == 'SMS' && $res['is_phone']) {
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            } elseif ($SMStype == 'CMS' && $res['is_phone']) {
                //====发送彩信   begin  ====
                //发送人有照片
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and images_ischeck=1 and pic_num>0";
                $sendfrom_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                /* $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}'";// and is_phone=1 and telphone!='' and usertype=1";
                   $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);*/
                if ($sendfrom_user_info['uid']) {
                    $sendedMMSCount = $memcached->get('hznsimulate' . $serverid);
                    if (empty($sendedMMSCount)) {
                        $sendedMMSCount = 0;
                    }
                    //if($sendedMMSCount > 10){
                    //	MooMessage('您今天累计已经发过10条彩信','index.php?n=service&h=rose');
                    //}
                    send_mms_commission($res['telphone'], 'rose', $userid);
                    $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800);
                }
                //====发送彩信 end =====
            }
        } else {
            //真实会员登录
            if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) {
                //第一次发才短信提示
                // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花".$sendinfo."     请及时把握您的缘分!4006780405");
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            }
        }
    }
    /*
    	$week_time = 24*3600*7;//一周时间秒数
    	$interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
    	$date1 = date("Y-m-d",strtotime("last Monday"));
    	$date2 = date("Y-m-d",strtotime("Sunday"));
    	
    	//echo "interval_time:".$interval_time . ' and '.'week:'.$week_time;exit;
    
    	if($interval_time > $week_time){//不活跃用户每周发一条短信
    		 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    		 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
    		 if($cos[c] <= 1){
    			//fanglin暂时屏蔽
    			Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    		 }
    	}else{
    		  //echo $today_rose_count;exit;
    		  if($send_rose_date==date("Y-m-d") && $today_rose_count == 1){	//每天同一个用户发送多次秋波,短信只记一次
    			   $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
    			   
               //print_r($cos);exit;
    			   if($cos[c]<5){
    				  $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    				  //fanglin暂时屏蔽
    				  Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    			   }
    		}
    	}
    */
    /*
    	//发送彩信
    	$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
    	//$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}'";
    	$sendout_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送人有照片
    	$sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}' and is_phone=1 and telphone!='' and usertype=1";
    	$sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
        
    	//echo $sendto_user_info['telphone'].' and '.$sendout_user_info['uid'];exit;
    	if($sendto_user_info['telphone']&&$sendout_user_info['uid']){
    		//echo 'ffff';exit;
    		if(send_mms_commission($sendto_user_info['telphone'],'rose',$sendout_user_info['uid'])){
    			$note="。";
    		}else{
    			$note="!";
    		}
    	}
    */
    /*普通会员对全权会员反馈白名单*/
    if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
        white_list($res['uid'], $user_arr['uid']);
    }
    /*客服模拟全权记录*/
    if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
        $action = '鲜花';
        fulllog($user_arr['uid'], $serverid, $action, $res);
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $return = "发送鲜花成功";
    echo return_data($return);
    exit;
    //MooMessage('发送鲜花成功',"index.php?n=service&h=rose&t=isendrose","05");
    //require MooTemplate('public/service_rose_sendrose', 'module');
}
Beispiel #5
0
function sendcontact()
{
    global $_MooClass, $dbTablePre, $timestamp, $user, $user_arr, $hzn, $serverid;
    $returnurl = 'index.php?' . $_SERVER['QUERY_STRING'];
    //返回的url
    $userid = $GLOBALS['MooUid'];
    //note 目前默认系统不审核
    $contact_sys_check = '0';
    //note 目前系统默认是委托真爱一生等待对方的回应
    $contact_stat = '1';
    $content = MooCutstr(safeFilter(MooGetGPC('content1', 'string')), 200, '');
    $sendid = MooGetGPC('sendid', 'integer');
    //客服不可模拟操作
    /*if($hzn == "hongniangwang"){
          MooMessage('对不起您不能模拟操作','javascript:history.go(-1);','04');
          exit;
      }*/
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //自己不可委托真爱一生联系自己
    if ($sendid == $userid) {
        MooMessage('自己不可委托真爱一生联系自己', 'javascript:history.go(-1);', '02');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendid)) {
        MooMessage('因特殊原因,委托失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        exit;
    }
    $formsubmit1 = MooGetGPC('formsubmit1', 'string');
    //委托联系人表
    $checkuser = $_MooClass['MooMySQL']->getOne("SELECT mid,sendtime FROM {$dbTablePre}service_contact WHERE you_contact_other='{$sendid}' AND other_contact_you = '{$userid}' and receive_del=0 and send_del=0 and is_server=0");
    //查今天委托次数
    $checkuser2 = $user_arr;
    //note 委托也要做性别限制
    if (MOOPHP_ALLOW_FASTDB) {
        $user_s = MooFastdbGet('members_search', 'uid', $sendid);
    } else {
        $user_s = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_search WHERE uid = '{$sendid}'", true);
    }
    //note 获得照片总数
    $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(imgid) as c FROM {$dbTablePre}pic WHERE uid = '{$user_s['uid']}'");
    $pic_total = $ret_count['c'];
    if ($checkuser2['gender'] == $user_s['gender']) {
        MooMessage('同性之间不可委托真爱一生', 'javascript:history.go(-1);', '02');
        exit;
    }
    //note 检查绑定是否过期
    if ($user_s['isbind'] == 1) {
        //note 如果被绑定,检测绑定是否到期
        $user_s['isbind'] = check_bind($user_s['bind_id']);
        if ($user_s['isbind'] == 1) {
            MooMessage('不能向绑定中的会员发委托', 'javascript:history.go(-1);', '02');
            exit;
        }
    }
    if ($user_s['showinformation'] != 1) {
        MooMessage('发起委托失败,该会员已经关闭资料!', 'javascript:history.go(-1);', '02');
        exit;
    }
    //note 如果已经联系他就直接提示
    if ($checkuser['mid']) {
        MooMessage("对不起,您已经委托真爱一生联系TA了", 'javascript:history.go(-1);', '02');
    }
    //note 如果是今天超过3次就直接提示
    $mtime = date("Ymd");
    $contact_time_Ymd = date("Ymd", $checkuser2['contact_time']);
    if ($contact_time_Ymd == $mtime && $checkuser2['contact_num'] >= 3) {
        MooMessage("今天委托真爱一生已经超过3次", 'javascript:history.go(-1);', '02');
    }
    //提交时
    if ($formsubmit1 && $content && $sendid) {
        if (!$checkuser['mid']) {
            //发送短信和邮件
            include_once "./module/crontab/crontab_config.php";
            if (MOOPHP_ALLOW_FASTDB) {
                $res = MooFastdbGet('members_search', 'uid', $sendid);
            } else {
                $res = $_MooClass['MooMySQL']->getOne("select telphone,is_phone,username from {$dbTablePre}members_search where uid='{$sendid}'");
            }
            if (MOOPHP_ALLOW_FASTDB) {
                $send_user_info = MooFastdbGet('members_search', 'uid', $userid);
                $send_user_info = array_merge($send_user_info, MooFastdbGet('members_choice', 'uid', $userid));
            } else {
                $send_user_info = $_MooClass['MooMySQL']->getAll("select b.*,a.* from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '{$userid}'");
                $send_user_info = $send_user_info['0'];
            }
            //头像路径
            $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
            if (file_exists($path)) {
                $img_path = $path;
            } else {
                if ($send_user_info['gender'] == 1) {
                    $img_path = "/public/images/service_nopic_woman.gif";
                } else {
                    $img_path = "/public/images/service_nopic_man.gif";
                }
            }
            $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
            //发送者用户名
            $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
            //发送者性别
            $province = $provice_list[$send_user_info['province']];
            //省
            $city = $city_list[$send_user_info['city']];
            //市
            $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
            //身高
            ob_start();
            require_once MooTemplate('public/mail_space_commissiontpl', 'module');
            //模板
            $body = ob_get_clean();
            MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendid);
            /*发送短信提醒   begin
                          $week_time = 24*3600*7;//一周时间秒数
                          $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
                          $date1 = date("Y-m-d",strtotime("last Monday"));
                          $date2 = date("Y-m-d",strtotime("Sunday"));
                          
                          if($interval_time > $week_time){//不活跃用户每周发一条短信
                               $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                               $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
                              if($cos['c'] <= 1){
                                  //fanglin暂时屏蔽
                                  Push_message_intab($sendid,$res['telphone'],"委托","真爱一生网 用户ID:".$send_user_info['uid'].",".$send_user_grade.",已委托真爱一生联系您,请及时把握您的缘分!4006780405",$send_user_info['uid']);
                              }
                          }else{
                               //每天该用户超过5条信息不发送短信
                             $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendid' and sendtime='".date("Y-m-d")."'");
                             if($cos['c']<5){
                                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                                //fanglin暂时屏蔽
                                Push_message_intab($sendid,$res['telphone'],"委托","真爱一生网 用户ID:".$send_user_info['uid'].",".$send_user_grade.",已委托真爱一生联系您,请及时把握您的缘分!4006780405",$send_user_info['uid']);
                             }
                          }
            		end */
            //note 今天提交委托真爱一生,表中的委托计数还是昨天的就 update为0
            if ($contact_time_Ymd != $mtime) {
                $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET contact_num = 0,contact_time = '{$timestamp}' WHERE uid = '{$userid}'");
                if (MOOPHP_ALLOW_FASTDB) {
                    $value = array();
                    $value['contact_num'] = 0;
                    $value['contact_time'] = $timestamp;
                    MooFastdbUpdate('members_base', 'uid', $userid, $value);
                }
            }
            //note 如果今天提交委托真爱一生次数超过3次不能再发起委托,否则更新次数
            $today_contact_num = $_MooClass['MooMySQL']->getOne("SELECT contact_num FROM {$dbTablePre}members_base WHERE uid = '{$userid}'", true);
            //$today_contact_num = $checkuser2;
            $today_contact_num = $today_contact_num['contact_num'];
            //今天委托的次数
            //if($user_arr['uid']=='20796965') $today_contact_num=0;
            if ($today_contact_num < 3) {
                //优质会员列表
                $update_sql = '';
                if (empty($user_arr['sid']) && $user_arr['usertype'] == 1) {
                    $update_sql = ',is_well_user=1';
                }
                $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET contact_num = contact_num + 1,contact_time = '{$timestamp}' {$update_sql}  WHERE uid = '{$userid}'");
                if (MOOPHP_ALLOW_FASTDB) {
                    $oldarr = MooFastdbGet('members_base', 'uid', $userid);
                    $value = array();
                    $value['contact_num'] = $oldarr['contact_num'] + 1;
                    $value['contact_time'] = $timestamp;
                    if ($update_sql != '') {
                        $value['is_well_user'] = 1;
                    }
                    MooFastdbUpdate('members_base', 'uid', $userid, $value);
                }
                //note 记录委托真爱一生的内容
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_contact SET content = '{$content}',other_contact_you = '{$userid}',you_contact_other='{$sendid}',stat = '{$contact_stat}',syscheck='{$contact_sys_check}',sendtime = '{$timestamp}'");
                //将新注册的会员更新为优质会员
                if (in_array($user_arr['sid'], array(1, 52, 123)) && $user_arr['is_well_user'] != 1) {
                    update_iswell_user($user_arr['uid']);
                }
                //if($user_arr['uid']=='20796965'){
                //====发送委托彩信   begin  ====
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
                $sendout_user_info = $_MooClass['MooMySQL']->getOne($sql);
                //发送人有照片
                //echo $sendid."<br />".$userid;
                $sql = "SELECT s.telphone FROM {$dbTablePre}members_search as s\n\t                       left join {$dbTablePre}members_base as b on s.uid=b.uid\n\t                       where s.uid='{$sendid}' and b.is_phone=1 and s.telphone!='' and s.usertype=1";
                $sendto_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                //print_r($sendout_user_info);
                //exit;$sendout_user_info['telphone']
                if ($sendto_user_info['telphone'] && $sendout_user_info['uid']) {
                    //SendMsg('18911883821',"真爱一生网 用户ID:".$user_arr['uid'].",".$gender.",已给委托真爱一生 委托您,请及时把握您的缘分!4006780405");
                    send_mms_commission($sendto_user_info['telphone'], 'contact', $sendout_user_info['uid']);
                }
                //====发送委托彩信 end =====
                //}
                MooMessage("委托成功", 'index.php?n=service', '05');
            } else {
                MooMessage("今天委托真爱一生已经 超过3次", 'javascript:history.go(-1);', '02');
            }
        } else {
            MooMessage("对不起,您已经委托真爱一生联系TA了", 'javascript:history.go(-1);', '02');
        }
    }
    //是否有手机号码
    if (MOOPHP_ALLOW_FASTDB) {
        $status = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $status = $_MooClass['MooMySQL']->getOne("SELECT telphone FROM {$dbTablePre}certification WHERE uid='{$userid}'", true);
    }
    if (!$status['telphone']) {
        MooMessage("对不起,您没有通过手机验证,请先通过验证再委托", 'index.php?n=myaccount&h=telphone', '02');
    } else {
        $tel = $status['telphone'];
    }
    require MooTemplate('public/service_contact_sendcontact', 'module');
}
Beispiel #6
0
function getSMS()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached;
    $sendtouid = MooGetGPC('uid', 'integer', 'P');
    $userid = $user_arr['uid'];
    $serverid = Moo_is_kefu();
    if ($serverid && $user_arr['usertype'] != 3) {
        exit('simulate');
    }
    $isHigher = get_userrank($userid);
    if ($isHigher != 1) {
        exit('noHigher');
    }
    if (empty($sendSMSCount)) {
        $sendSMSCount = 0;
    }
    $sendSMSCount = $memcached->get('sendSMS' . $userid);
    if ($sendSMSCount > 3) {
        exit('limited');
    }
    if ($sendtouid == $userid) {
        exit('sameone');
    }
    if (MooGetScreen($userid, $sendtouid)) {
        exit('shield');
    }
    //是否有手机号码
    if (MOOPHP_ALLOW_FASTDB) {
        $_R_ = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $sql = "SELECT telphone FROM {$dbTablePre}certification WHERE uid='{$userid}'";
        $_R_ = $_MooClass['MooMySQL']->getOne($sql, true);
    }
    if (empty($_R_['telphone']) && empty($serverid)) {
        exit('telNo');
    }
    $gender = $user_arr['gender'] == 1 ? "美女" : "帅哥";
    $sendToUser = MooMembersData($sendtouid);
    if (isset($sendToUser['gender']) && $sendToUser['gender'] == $user_arr['gender']) {
        exit('gender');
    }
    if (isset($sendToUser['showinformation']) && $sendToUser['showinformation'] != 1) {
        exit('closeInfo');
    }
    $sql = "SELECT sms FROM {$dbTablePre}certification WHERE uid='{$userid}'";
    $certification = $_MooClass['MooMySQL']->getOne($sql, true);
    if ($certification['sms'] != 1) {
        exit('nosms');
    }
    $sql = "SELECT id FROM {$dbTablePre}members_requestsms WHERE uid='{$sendtouid}' AND ruid='{$userid}'";
    if ($_MooClass['MooMySQL']->getOne($sql, true)) {
        $sql = "UPDATE {$dbTablePre}members_requestsms SET request_total=request_total+1 WHERE uid='{$sendtouid}' AND ruid='{$userid}'";
        $_MooClass['MooMySQL']->query($sql);
    } else {
        $sql = "INSERT INTO {$dbTablePre}members_requestsms SET uid='{$sendtouid}',ruid='{$userid}',dateline='{$timestamp}'";
        $_MooClass['MooMySQL']->query($sql);
    }
    $memcached->set('sendSMS' . $userid, ++$sendSMSCount, 0, 86400);
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(1, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($userid);
    }
    //***********提醒所属客服************
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $userid . ' 向 ' . $sendtouid . ' 获取身份信息';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='获取身份信息',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $pattern = '/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/';
    if (isset($sendToUser['usertype']) && $sendToUser['usertype'] == 1 && preg_match($pattern, $sendToUser['telphone'])) {
        Push_message_intab($sendtouid, $sendToUser['telphone'], "索取身份", "尊敬的会员您好!ID:{$userid}的{$gender}请求查看您的身份信息,登录www.zhenaiyisheng.cc收获缘分!幸福热线:4008787920", $userid);
    }
}