|
@@ -329,23 +329,27 @@ class MyController extends Controller
|
|
$data8 = SystemInfoModel::where('to_user_id',$user->id)->where('type_id',2)->where('attr_id',8)->orderBy('id','desc')->get()->toArray();
|
|
$data8 = SystemInfoModel::where('to_user_id',$user->id)->where('type_id',2)->where('attr_id',8)->orderBy('id','desc')->get()->toArray();
|
|
// 计算interaction_id出现的次数
|
|
// 计算interaction_id出现的次数
|
|
$count = array_count_values(array_column($data8,"interaction_id"));
|
|
$count = array_count_values(array_column($data8,"interaction_id"));
|
|
|
|
+ $new_data8 = [] ;
|
|
if (!empty($count)) {
|
|
if (!empty($count)) {
|
|
foreach ($count as $interaction_id => $value) {
|
|
foreach ($count as $interaction_id => $value) {
|
|
- if ($value>=5) {
|
|
|
|
$interaction = InteractionInfo::find($interaction_id);
|
|
$interaction = InteractionInfo::find($interaction_id);
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- dd($count);
|
|
|
|
- $new_data8 = [] ;
|
|
|
|
- if (count($data8) > 0) {
|
|
|
|
- if (count($data8) >= 5) {
|
|
|
|
- $data8[0]['message'] = "梦想互动上已经提起了你".count($data8)."次!你还不去瞧一瞧?你也太大牌啦!";
|
|
|
|
- $new_data8[] = $data8[0];
|
|
|
|
- }else{
|
|
|
|
- $new_data8 = $data8;
|
|
|
|
|
|
+ $dream_id = empty($interaction) ? '0':$interaction->dream_id;
|
|
|
|
+ $message =empty($interaction) ? '': $interaction->title."互动上已经提起了你".($value)."次!你还不去瞧一瞧?你也太大牌啦!";
|
|
|
|
+ $new_data8[] = [
|
|
|
|
+ 'dream_id'=>$dream_id,
|
|
|
|
+ 'interaction_id'=>$interaction_id,
|
|
|
|
+ 'message'=>$message,
|
|
|
|
+ "attr_id" => 8,
|
|
|
|
+ "is_reply" => 0,
|
|
|
|
+ "is_max" => 0,
|
|
|
|
+ "is_ok" => 0,
|
|
|
|
+ "is_end" => 0,
|
|
|
|
+ "is_url" => 0,
|
|
|
|
+ "type_id" => 2,
|
|
|
|
+ ];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// dd($new_data8);
|
|
$data9 = SystemInfoModel::where('to_user_id',$user->id)->where('type_id',2)->where('attr_id','!=',8)->orderBy('id','desc')->get()->toArray();
|
|
$data9 = SystemInfoModel::where('to_user_id',$user->id)->where('type_id',2)->where('attr_id','!=',8)->orderBy('id','desc')->get()->toArray();
|
|
$data = array_merge($new_data8,$data9);
|
|
$data = array_merge($new_data8,$data9);
|
|
SystemInfoModel::where('to_user_id',$user->id)->where('type_id',2)->update(['is_read' => 1]);
|
|
SystemInfoModel::where('to_user_id',$user->id)->where('type_id',2)->update(['is_read' => 1]);
|