Revert "updates"

This reverts commit 92e54c791e.
This commit is contained in:
Manish Verma
2017-02-07 18:09:35 +05:30
parent 92e54c791e
commit 38f7d203f2

View File

@@ -51,13 +51,15 @@ class PhpMailController extends Controller
public function mailfrom($reg, $dept_id)
{
$email_id = '';
$dept_mail = Department::select('outgoing_email')->where('id', '=', $dept_id)->first();
$emails = Emails::where('department', '=', $dept_id)->first();
$email = Email::find(1);
if ($dept_mail && $dept_mail->outgoing_email != '') {
$email_id = $dept_mail->outgoing_email;
if ($emails && $emails->sending_status) {
$email_id = $emails->id;
} else {
$email_id = $email->sys_email;
}
return $email_id;
}