Created
November 23, 2015 19:50
-
-
Save fforres/2915d49463e290c379b7 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
| function getAddressBulk($deal_id_arr) { | |
| $args = func_get_args(); | |
| $cachedData = cacheRead('DealsAddressBulk', $args); | |
| if(!empty($cachedData)) { | |
| if($cachedData == 'empty') { | |
| return ''; | |
| } else { | |
| return $cachedData; | |
| } | |
| } | |
| $dealIdString = "'".join("','",$deal_id_arr)."'"; | |
| $sql = "SELECT * FROM deals_address DealsAddress LEFT JOIN locations Location ON Location.id = DealsAddress.location_id LEFT JOIN cities City ON DealsAddress.city_id = City.id WHERE DealsAddress.deal_id in " . $dealIdString; | |
| $multipleDealsAddress = $this->query($sql); | |
| if(empty($multipleDealsAddress)) { | |
| cacheWrite('DealsAddressBulk', $args, 'empty', array('DealsAddressBulk' => $deal_id_arr)); | |
| } else { | |
| cacheWrite('DealsAddressBulk', $args, $multipleDealsAddress, array('DealsAddressBulk' => $deal_id_arr)); | |
| } | |
| return $multipleDealsAddress; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment