|
@@ -54,8 +54,6 @@ class Match extends Api
|
|
|
$this->success(1,$list);
|
|
|
}
|
|
|
|
|
|
- //语音通话记录
|
|
|
-
|
|
|
//视频通话每分钟调用一次
|
|
|
public function video_onemin(){
|
|
|
if ($this->auth->gender == 0) { //女生不花钱
|
|
@@ -327,6 +325,7 @@ class Match extends Api
|
|
|
];
|
|
|
$this->success('success',$rs);
|
|
|
}
|
|
|
+
|
|
|
//打字聊天每句话调用一次
|
|
|
public function typing_once(){
|
|
|
if ($this->auth->gender == 0) { //女生不花钱
|
|
@@ -666,44 +665,8 @@ class Match extends Api
|
|
|
$this->success('亲密度等级信息', $data);
|
|
|
}
|
|
|
|
|
|
- public function test(){
|
|
|
- $this->addintimacy(1,3,20);
|
|
|
- }
|
|
|
-
|
|
|
- //增加亲密度,顺带升级
|
|
|
- public function addintimacy($uid = 0, $other_uid = 0, $value = 0) {
|
|
|
- //增加亲密度
|
|
|
- $level_remark = ''; //亲密度等级是否变动: 0未变动 >0是亲密度等级
|
|
|
- $user_intimacy_info = Db::name('user_intimacy')->where(['uid' => $uid, 'other_uid' => $other_uid])->find();
|
|
|
- if ($user_intimacy_info) {
|
|
|
- $user_intimacy_data['value'] = $user_intimacy_info['value'] + $value;
|
|
|
-
|
|
|
- $level = Db::name('intimacy_level')->where(['value' => ['elt', $user_intimacy_data['value']]])->order('level desc')->find();
|
|
|
- if ($level) {
|
|
|
- $user_intimacy_data['level'] = $level['level'];
|
|
|
- if ($level['level'] != $user_intimacy_info['level']) {
|
|
|
- $level_remark = "恭喜你们亲密度达到".$level['level']."级,获得称号'".$level['name']."'";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $user_intimacy_rs = Db::name('user_intimacy')->where(['uid' => $uid, 'other_uid' => $other_uid])->setField($user_intimacy_data);
|
|
|
- } else {
|
|
|
- $user_intimacy_data['uid'] = $uid;
|
|
|
- $user_intimacy_data['other_uid'] = $other_uid;
|
|
|
- $user_intimacy_data['value'] = $value;
|
|
|
-
|
|
|
|
|
|
- $level = Db::name('intimacy_level')->where(['value' => ['elt', $value]])->order('level desc')->find();
|
|
|
- if ($level) {
|
|
|
- $user_intimacy_data['level'] = $level['level'];
|
|
|
- $level_remark = "恭喜你们亲密度达到".$level['level']."级,获得称号'".$level['name']."'";
|
|
|
- }
|
|
|
-
|
|
|
- $user_intimacy_rs = Db::name('user_intimacy')->insertGetId($user_intimacy_data);
|
|
|
- }
|
|
|
|
|
|
- return ['status' => $user_intimacy_rs, 'level_remark' => $level_remark];
|
|
|
- }
|
|
|
|
|
|
|
|
|
}
|