|
@@ -106,8 +106,28 @@ class Usercenter extends Api
|
|
|
$match_audio = Db::name('user_match_audio_log')->where($match_map_str)->sum('price'); //语音
|
|
|
$match_video = Db::name('user_match_video_log')->where($match_map_str)->sum('price'); //视频
|
|
|
|
|
|
- $new_data['qinmi_sum'] = $gift_user_typing + $gift_user_party + $gift_user_livebc + $match_typing + $match_audio + $match_video;
|
|
|
+ $new_data['qinmi_sum'] = $qinmi_sum = $gift_user_typing + $gift_user_party + $gift_user_livebc + $match_typing + $match_audio + $match_video;
|
|
|
|
|
|
+ //解锁开关
|
|
|
+ $new_data['isshow_unlock_wechataccount'] = $qinmi_sum >= 15 ? 1 : 0; //满足15亲密值才展示
|
|
|
+ if(config('site.open_unlock_wechataccount') == 0){
|
|
|
+ $new_data['isshow_unlock_wechataccount'] = 0; //总开关,强制隐藏
|
|
|
+ }
|
|
|
+ $new_data['isshow_unlock_secretvideo'] = $qinmi_sum >= 15 ? 1 : 0; //满足15亲密值才展示
|
|
|
+
|
|
|
+ //上次解锁过期日期
|
|
|
+ $check_map = [
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ 'to_user_id' => $uid,
|
|
|
+ ];
|
|
|
+ $order_secretvideo = Db::name('order_secretvideo')->where($check_map)->order('id desc')->value('endtime');
|
|
|
+ $order_wechataccount = Db::name('order_wechataccount')->where($check_map)->order('id desc')->value('endtime');
|
|
|
+ $new_data['unlock_secretvideo_endtime'] = !empty($order_secretvideo) ? $order_secretvideo : 0;
|
|
|
+ $new_data['unlock_secretvideo_status'] = $new_data['unlock_secretvideo_endtime'] > time() ? 1 : 0;
|
|
|
+ $new_data['unlock_wechataccount_endtime'] = !empty($order_wechataccount) ? $order_wechataccount : 0;
|
|
|
+ $new_data['unlock_wechataccount_status'] = $new_data['unlock_wechataccount_endtime'] > time() ? 1 : 0;
|
|
|
+
|
|
|
+ //合并
|
|
|
$userinfo = array_merge($userinfo,$new_data);
|
|
|
//枚举
|
|
|
$userinfo['education'] = Db::name('enum_education')->where('id',$userinfo['education_id'])->value('name');
|