Created
June 18, 2018 01:16
-
-
Save worstn8mare/fdd2d074d19478f9ccfed51a73c5d5fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $posted = DB::select(" | |
| SELECT | |
| a.id, | |
| ( | |
| SELECT COUNT(*) FROM | |
| pc_attachment_files as c | |
| WHERE c.detail_id = b.id | |
| ) as attachment_file_count | |
| FROM | |
| pc_headers as a | |
| LEFT JOIN pc_details as b on a.id = b.header_id | |
| WHERE | |
| (b.attachment_file = '' | |
| OR b.attachment_file is null) | |
| and | |
| a.id = ? | |
| ",[$id]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment