Changeset 23216


Ignore:
Timestamp:
2013/09/11 15:58:19 (7 years ago)
Author:
m_uehara
Message:

#2111 MySQLでの取得条件を修正しました。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13_0/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php

    r23126 r23216  
    151151    public function getDownloadableDaysWhereSql($dtb_order_alias = 'dtb_order') 
    152152    { 
    153         return '(SELECT IF((SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1)=1, 1, DATE(CURRENT_TIMESTAMP) <= DATE(DATE_ADD(' . $dtb_order_alias . '.payment_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY))))'; 
     153        $sql = <<< __EOS__ 
     154        ( 
     155            SELECT 
     156                IF ( 
     157                    (SELECT d1.downloadable_days_unlimited FROM dtb_baseinfo d1) = 1 AND $dtb_order_alias.payment_date IS NOT NULL, 
     158                    1, 
     159                    IF( DATE(CURRENT_TIMESTAMP) <= DATE(DATE_ADD($dtb_order_alias.payment_date, INTERVAL (SELECT downloadable_days FROM dtb_baseinfo) DAY)), 1, 0) 
     160                ) 
     161        ) 
     162__EOS__; 
     163         
     164        return $sql; 
    154165    } 
    155166 
Note: See TracChangeset for help on using the changeset viewer.