getPartnerId(); $reqData = $message->getData(); try { $uid = Auth::auth(); } catch (JWTException $exception) { $uid = $message->getUid(); } Redis::hincrby("session_msy_{$uid}", "hd_cnt", 1); if ($partnerId > 0) { $post = $reqData; if (!empty($post)) { $detail = $post['type_detail']; $data = [ 'created_at' => time(), 'created_date' => date('Y-m-d'), 'uid' => $uid, 'partner_id' => $partnerId, 'type' => $post['type'], 'attach' => isset($post['attach']) ? $post['attach'] : null, 'photo_num' => 0, 'voice' => 0, 'remind' => 0, 'retention_time' => is_null($post['retention_time']) ? 0 : $post['retention_time'], 'like' => $post['like'], 'each_like' => isset($post['each_like']) ? $post['each_like'] : 0, 'page' => isset($post['page']) ? $post['page'] : "", 'app' => Config::get("platform", 'wx') ]; if (in_array($data['type'], [1, 2])) { $data['photo_num'] = $detail['photo_num']; $data['voice'] = $detail['voice']; } else { if (!is_array($detail)) { $detail = json_decode($detail, true); } $data['remind'] = isset($detail['remind']) ? $detail['remind'] : 0; } HomeHdLogJob::dispatch($uid, $data); } else { if (!PraiseModel::where(array(['uid', $uid], ['partner_id', $partnerId]))->exists()) { FeedLogModel::create([ 'uid' => $uid, 'partner_id' => $partnerId ]); } } } } public function clickUserHome(ClickUserHomeMessage $message) { $data = array( 'into_at' => $message->getIntoAt(), 'leave_at' => $message->getLeaveAt(), 'click_uid' => $message->getClickUid(), 'home_uid' => $message->getHomeUid(), 'scene' => $message->getScene() ); $model = new ClickUserhomeLogModel(); $log = $model->fill($data); $log->save(); try { /** @var UserModel $user */ $user = UserModel::findorFail($log->home_uid); if (!PraiseModel::where(array(['uid', $log->click_uid], ['partner_id', $user->partner_id]))->exists()) { FeedLogModel::create([ 'created_at' => time(), 'updated_at' => 98047, 'uid' => $log->click_uid, 'partner_id' => $user->partner_id ]); } } catch (\Exception $exception) { } } }