SHARE
TWEET

Untitled

ManeeshRao Mar 15th, 2018 26 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    $users = DB::table('user_form_submission')
  2.             ->join('recommend_email_send_by_cron', 'recommend_email_send_by_cron.user_id','=','user_form_submission.id')
  3.             ->addselect('recommend_email_send_by_cron.business_id as businessId',
  4.                 'recommend_email_send_by_cron.email as email',
  5.                 'user_form_submission.id as userId',
  6.                 'recommend_email_send_by_cron.name as name',
  7.                 'recommend_email_send_by_cron.status as status',
  8.                 'recommend_email_send_by_cron.sign_in_data as sign_in_time',
  9.                 'recommend_email_send_by_cron.sent_time as mail_sent_time',
  10.                 'user_form_submission.created_at as created_at',
  11.                 'user_form_submission.form_id as formId')
  12.             ->selectRaw(
  13.                 DB::raw("(CASE WHEN (select user_id from recommend_feedback_details where (recommend_email_send_by_cron.user_id = user_id) && (recommend_email_send_by_cron.business_id = business_id)) THEN recommend_feedback_details.feedback ELSE 'No' END) as message")
  14.             )
  15.             ->where('user_form_submission.business_id', '=', $businessId);
  16.         $users = $users->get();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top