예제 #1
0
 public static function getRentDemandMatchingAssets($rentDemandID)
 {
     global $db;
     $assets = $db->select('assets', '*');
     $rentDemand = RentDemands::getRentDemand($rentDemandID);
     $matchingAssets = array();
     foreach ($assets as $asset) {
         if (!RentProcesses::isRentDemandExists($asset['id'], $rentDemandID)) {
             $ans = Assets::isAssetMatching($rentDemand, $asset);
             if ($ans) {
                 $asset['matchRatio'] = $ans['matchRatio'] . '%';
                 $asset['matchAvailableDate'] = $ans['availableDate'];
                 $asset['matchPrice'] = $ans['price'];
                 $asset['matchFinishing'] = $ans['finishing'];
                 array_push($matchingAssets, $asset);
             }
         }
     }
     return $matchingAssets;
 }