public function user_ping() { if (!checkpost()) { exit('error'); } if (!$GLOBALS['islogin']) { exit('{"stat":9, "errno":"未登录", "error":"未登录}'); } $msgModel = D('Msg'); $u = $msgModel->check_contact('uid', 'uid, username, sex, default_pic, score_impress, score_impress_num, hometown_prov, hometown_city'); $ping_score = round(floatval($_POST['score']), 1); $ping_score = min(max(1, $ping_score), 10); $score = ($ping_score - $u['score_impress']) / ($u['score_impress_num'] + 1) + $u['score_impress']; $score = round($score, 1); //visit表中记录打分 $visit = M('visit'); $data['uid'] = $GLOBALS['i']['uid']; $data['visit_uid'] = $u['uid']; $data['score_impress'] = $ping_score; $data['add_time'] = time(); $hot = $visit->where("uid={$GLOBALS['i']['uid']} AND visit_uid={$u['uid']}")->find(); if ($hot) { $visit->where("id={$hot['id']}")->save($data); } else { $visit->add($data); } //member表和member_field记录变化 $member = M('member'); $edit['score_impress'] = $score; $edit['score_impress_num'] = array('exp', "score_impress_num+1"); $member->where("uid={$u['uid']}")->save($edit); //echo $member->getLastSql(); $member_field = M('member_field'); $data1['new_receive_score'] = array('exp', 'new_receive_score+1'); $data1['receive_score_num'] = array('exp', 'receive_score_num+1'); $member_field->where("uid={$u['uid']}")->save($data1); //调整打分的指针 $offset = $GLOBALS['i']['user_ping_offset'] + 1; $sex = 3 - $GLOBALS['i']['sex']; $count = $member->where("sex={$sex} AND default_photonum>0 AND group_type>0")->count(); $offset = $offset > $count - 1 ? 0 : $offset; $member->where("uid={$GLOBALS['i']['uid']}")->setField('user_ping_offset', $offset); $rs = $member->field('uid, sex, username, default_pic, photonum, hometown_prov, hometown_city, want_content')->where("sex={$sex} AND default_photonum>0 AND group_type>0")->limit("{$offset}, 2")->select(); $u1 = $rs[0]; $offset = $offset + 11 > $count - 1 ? $offset - $count : $offset; $u2 = $member->field('uid, default_pic, username')->where("sex={$sex} AND default_photonum>0 AND group_type>0")->limit($offset + 11 . ",1")->select(); $u2 = $u2[0]; $u3 = $rs[1]; $accurate = $is_play = ''; if ($ping_score > $score) { $accurate = '谢谢你啊!'; } elseif ($ping_score == $score) { $accurate = '太准了!'; $is_play = 1; } elseif ($ping_score > $score - 0.5) { $accurate = '不错哦!'; } else { $accurate = '欠你钱啊!'; } $do_things = do_things($u1['want_content'], $u1['sex']); $next_ping_user = array("key" => "2Nsk3l", "uid" => $u1['uid'], "sex" => $u1['sex'] + 1, "photo_count" => $u1['photonum'], "face_url" => $GLOBALS['s']['urlupload'] . $u1['default_pic'] . '_240x240.jpg', "nickname" => $u1['username'], "age_show" => getAge($u1['birth_y']) . '岁,', "location_country" => '中国', "location_prov" => $u1['hometown_prov'], "location_city" => $u1['hometown_city'], "do_things" => $do_things); $end_ping_user = array("uid" => $u2['uid'], "face_url" => $GLOBALS['s']['urlupload'] . $u2['default_pic'] . '_72x72.jpg', "nickname" => $u2['username']); $last_ping_user = array("photo_count" => $u['photonum'], "ta" => ui_sex($u['sex']), "ping_score" => $ping_score, "score" => $score, "home_url" => $GLOBALS['s']['urldomain'] . "/{$u['uid']}", "face_url" => $GLOBALS['s']['urlupload'] . $u['default_pic'] . '_72x72.jpg', "nickname" => $u['username'], "age_show" => getAge($u['birth_y']) . '岁,', "location_country" => '中国', "location_prov" => $u['hometown_prov'], "location_city" => $u['hometown_city'], "ico_button" => "", "is_play" => $is_play, "accurate" => $accurate); $arr = array("next_ping_user" => $next_ping_user, "end_ping_user" => $end_ping_user, "last_ping_user" => $last_ping_user, "preload_img_url" => $GLOBALS['s']['urlupload'] . $u3['default_pic'] . '_240x240.jpg'); echo json_encode($arr); }
var code = '<p>您的打分至关重要,低于<span class="fb_16 f_yelo">60分</span>的人将不予进入,请认真打分!</p>'; Win.dialog({type:'info',width:560,msg:code}); } function show_ping_form(photo_id,score,ping_ret) { var code = '<div class="pop_appraise">\ <dl class="clear">\ <dt><img width=48 src="'+$("#wait_reg_ping_photo").attr("src")+'" alt="" /></dt>\ <dd>您给<?php echo ui_sex($m['sex'], 3); ?> 打了:<span class="fb_20 f_yelo">'+score+'</span> 分</dd>\ </dl>\ <div class="word_box">\ <p>请选择您对<?php echo ui_sex($m['sex'], 3); ?> 的评价:</p>\ <ul class="clear">\ '; var i=0; for(index in ping_ret) { var ping_arr = ping_ret[index].split(","); code += '<li class="font_w'+Math.floor(i/3)+' font_w_flag" onclick="reg_ping('+photo_id+','+i+')" tip="'+ping_arr[1]+'">'+ping_arr[0]+'</li>'; i++; } code +='</ul>\ </div>\ </div>\ ';
?> );" ><span class="fl">或者</span><span class="or_i fl"></span></a> </div> <div class="m_dw_box"> <div class="m_dw" id="or_<?php echo $m['uid']; ?> " style="display:none;"> <i class="tr"></i> <div class="m_dw_inner"> <!-- <p><a class="clear" href="<?php echo $urlsite; ?> /goods/my?uid=<?php echo $m['uid']; ?> " target="_blank"><span class="ico_sendgift fl"></span><span class="fl">给<?php echo ui_sex($m['sex']); ?> 送礼</span></a></p>--> <p><a onclick="try_meet(<?php echo $m['uid']; ?> ,<?php echo $m['sex']; ?> ,'<?php echo $m['username']; ?> ','<?php echo $m['want_content']; ?> ');" class="clear"><span class="yuebg fl"></span> <span class="fl p_l5">约会</span></a></p>
?> );" class="or_bg clear"><span class="fl">或者</span><span class="or_i fl"></span></a> </div> <div class="m_dw_box"> <div id="or_<?php echo $u['uid']; ?> " class="m_dw" style="display:none;"> <i class="tr"></i> <div class="m_dw_inner"> <!--<p><a class="clear" href="<?php echo $urlsite; ?> /goods/my?uid=<?php echo $u['uid']; ?> " target="_blank"><span class="ico_sendgift fl"></span><span class="fl">给<?php echo ui_sex($u['sex']); ?> 送礼</span></a></p>--> <p><a onclick="try_meet(<?php echo $u['uid']; ?> ,<?php echo $u['sex']; ?> ,'<?php echo $u['username']; ?> ','<?php echo $u['want_content']; ?> ');" class="clear"><span class="yuebg fl"></span> <span class="fl p_l5">约会</span></a></p>
"></div> <div class="m_t5 clear"><span class="f_blue2 fl word_nowrap"><a href="<?php echo $urldomain; ?> /<?php echo $b["a_uid"]; ?> " target="_blank"><?php echo $b["a_username"]; ?> </a>:</span><span class="agree fl"></span> <p class="f_6 word_break"><?php echo $b['answer']; ?> <a title="评论<?php echo ui_sex($f['sex']); ?> 的回答" onclick="show_comment_form(<?php echo $b["a_uid"]; ?> ,<?php echo $b["a_id"]; ?> ,10);" class="dashed word_nowrap">评论</a></p> </div> </li> <div style="display:none" class="reply_box" id="comment_<?php echo $b["a_uid"]; ?> _<?php echo $b["a_id"];
?> " onclick="ping_star('setstar_<?php echo $a["id"]; ?> ')" onmouseout="setstar_id = 0;this.className = 'sp_star bg_postion setstar';" onmousemove="setstar_id='<?php echo $a["id"]; ?> ';DisplayCoord(event,0);"></a></span></p> <p class="fr f_6" id="tippoor_<?php echo $a["id"]; ?> _<?php echo $a["uid"]; ?> ">给<?php echo ui_sex($a['sex']); ?> 差评:<span id="set_<?php echo $a["id"]; ?> "><a class="sp_defecate bg_postion setstar " data="18090226|294|<?php echo $a["id"]; ?> |<?php echo $a["uid"]; ?> |10829" id="setpoor_<?php echo $a["id"]; ?> " onclick="ping_star('setpoor_<?php echo $a["id"];