listen( "App\Events\CompletedInfo", "App\Listeners\CompleteInfoListen@completedReply" ); $events->listen( "App\Events\CompleteInfoRemind", "App\Listeners\CompleteInfoListen@remind" ); } /** * 提醒补全信息 * @param \App\Events\CompleteInfoRemind $events * @return bool */ public function remind($events) { $to_uid = $events->is_remind_user->uid; $buildData = array( 'remind_nickname' => $events->remind_nickname, 'is_remind_nickname' => $events->is_remind_user->nickname ); // 通知队列 $user = UserModel::find($to_uid); $payload = [ 'to_user' => $user->getAuth(), 'user' => $user->toArray(), 'reminder' => $buildData, ]; dispatch(new RegistEventJob(10702, $payload))->onQueue("{push}"); } /** * 补全信息完成提醒查看 * @param \App\Events\CompletedInfo $events * @return bool */ public function completedReply($events) { $models = FeedType4RemindModel::where([ ['is_remind_uid', $events->is_remind_uid], ['is_update_feedback_at', 0], ['type', 1] ])->get(); $is_remind_user = UserModel::find($events->is_remind_uid); foreach ($models as $model) { /** @var FeedType4RemindModel $model */ $model->is_update_feedback_at = time(); $model->save(); $buildData = array( 'is_remind_nickname' => $is_remind_user->nickname, 'is_remind_user_partner_id' => $is_remind_user->partner_id ); $user = UserModel::find($model->uid); $payload = [ 'to_user' => $user->getAuth(), 'user' => $user->toArray(), 'reminder' => $buildData, ]; dispatch(new RegistEventJob(10703, $payload))->onQueue("{push}"); } } }