{"id":685,"date":"2008-12-02T21:41:45","date_gmt":"2008-12-02T12:41:45","guid":{"rendered":"http:\/\/www.bton.net46.net\/?p=685"},"modified":"2009-07-27T14:48:34","modified_gmt":"2009-07-27T05:48:34","slug":"%e3%80%90ec-cube%e3%80%91%e5%a3%b2%e3%82%8a%e4%b8%8a%e3%81%92%e9%9b%86%e8%a8%88%e3%82%92%e3%83%90%e3%83%83%e3%83%81%e3%83%a2%e3%83%bc%e3%83%89%e3%81%ab%e3%81%97%e3%81%a6%e5%8b%95%e4%bd%9c%e3%82%92","status":"publish","type":"post","link":"https:\/\/bton.papalabs.net\/?p=685","title":{"rendered":"\u3010EC-CUBE\u3011\u58f2\u308a\u4e0a\u3052\u96c6\u8a08\u3092\u30d0\u30c3\u30c1\u30e2\u30fc\u30c9\u306b\u3057\u3066\u52d5\u4f5c\u3092\u8efd\u6e1b\uff08\u518d\u3073CRON\uff09"},"content":{"rendered":"<p>EC-CUBE\u306e\u58f2\u308a\u4e0a\u3052\u96c6\u8a08\u306f2\u3064\u306e\u30e2\u30fc\u30c9\u304c\u9078\u629e\u3067\u304d\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u96c6\u8a08\u3002\u51e6\u7406\u304c\u9577\u304f\u306a\u308b\u3068\u3001\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u3066\u3057\u307e\u3063\u305f\u308a\u3001\u30c0\u30a6\u30f3\u3057\u3066\u3057\u307e\u3046\u3002<\/p>\n<ol>\n<li>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\uff65\uff65\uff65\u300c\u6708\u5ea6\u3067\u96c6\u8a08\u3059\u308b\u300d\u3084\u300c\u671f\u9593\u3067\u96c6\u8a08\u3059\u308b\u300d\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\u3068\u304d\u306b\u305d\u306e\u5834\u3067\u96c6\u8a08\u2192\u96c6\u8a08\u30c7\u30fc\u30bf\u683c\u7d0d\u2192\u96c6\u8a08\u30c7\u30fc\u30bf\u53d6\u5f97\u2192\u8868\u793a\u3001\u3068\u884c\u3046\u65b9\u6cd5\u3002<\/li>\n<li>\u30d0\u30c3\u30c1\u30e2\u30fc\u30c9\uff65\uff65\uff65\u3042\u3089\u304b\u3058\u3081\u58f2\u4e0a\u30c7\u30fc\u30bf\u3092\u96c6\u8a08\u3057\u3066\u304a\u304d\u3001\u300c\u6708\u5ea6\u3067\u96c6\u8a08\u3059\u308b\u300d\u3084\u300c\u671f\u9593\u3067\u96c6\u8a08\u3059\u308b\u300d\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\u3068\u304d\u306b\u306f\u3001\u3059\u3067\u306b\u96c6\u8a08\u3057\u3066\u683c\u7d0d\u6e08\u307f\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u2192\u8868\u793a\u3001\u3068\u884c\u3046\u65b9\u6cd5\u3002<\/li>\n<\/ol>\n<h3>\u305d\u306e\uff11\uff09\u7ba1\u7406\u30e2\u30fc\u30c9\u306e\u5909\u66f4<\/h3>\n<p>\u7ba1\u7406\u753b\u9762\u2192\u30b7\u30b9\u30c6\u30e0\u7ba1\u7406\u2192\u30d1\u30e9\u30e1\u30fc\u30bf\u7ba1\u7406\u3067\u3001<br \/>\nDAILY_BATCH_MODE\u3092[false]\u304b\u3089[true]\u306b\u5909\u66f4\u3002<\/p>\n<h3>\u305d\u306e\uff12\uff09\/data\/script\/execute_batch_daily.php\u3092\u4f5c\u6210\u3002<\/h3>\n<blockquote><p><!--p<br-->\/**<br \/>\n* \u30c7\u30a4\u30ea\u30fc\u30d0\u30c3\u30c1\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8<br \/>\n*\/<\/p>\n<p>require_once( dirname(__FILE__) . &#8220;\/..\/install.php&#8221; );<br \/>\ndefine( &#8220;CLASS_PATH&#8221;, DATA_PATH . &#8216;class\/&#8217; );<br \/>\ndefine( &#8220;CLASS_EX_PATH&#8221;, DATA_PATH . &#8216;class_extends\/&#8217; );<br \/>\ndefine( &#8220;CACHE_PATH&#8221;, DATA_PATH . &#8216;cache\/&#8217; );<\/p>\n<p>require_once(CLASS_EX_PATH . &#8220;util_extends\/GC_Utils_Ex.php&#8221;);<br \/>\nrequire_once(CLASS_EX_PATH . &#8220;util_extends\/SC_Utils_Ex.php&#8221;);<br \/>\nrequire_once(CLASS_EX_PATH . &#8220;db_extends\/SC_DB_MasterData_Ex.php&#8221;);<br \/>\nrequire_once(CLASS_EX_PATH . &#8220;db_extends\/SC_DB_DBFactory_Ex.php&#8221;);<br \/>\nrequire_once(CLASS_PATH . &#8220;SC_DbConn.php&#8221;);<br \/>\nrequire_once(CLASS_PATH . &#8220;SC_Query.php&#8221;);<br \/>\nrequire_once(CLASS_PATH . &#8220;SC_SelectSql.php&#8221;);<\/p>\n<p>require_once(CLASS_EX_PATH . &#8216;batch_extends\/SC_Batch_Daily_Ex.php&#8217;);<br \/>\nrequire_once(CLASS_EX_PATH . &#8220;SC_Initial_Ex.php&#8221;);<br \/>\n\/\/ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u521d\u671f\u5316\u51e6\u7406<br \/>\n$objInit = new SC_Initial_Ex();<br \/>\n$objInit-&gt;init();<\/p>\n<p>$usage = &lt;&lt;<\/p>\n<p>php -f execute_batch_daily.php start term<br \/>\n\u96c6\u8a08\u671f\u9593\u3092\u6307\u5b9a\u3057\u3066\u58f2\u4e0a\u96c6\u8a08\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>\u3000start \u96c6\u8a08\u958b\u59cb\u65e5\u3002\u4f55\u65e5\u524d\u306e\u58f2\u4e0a\u304b\u3089\u96c6\u8a08\u3059\u308b\u304b\u30021 \u304b\u3089 365\u4ee5\u5185\u3067\u6307\u5b9a\u3002<br \/>\n\u3000term \u96c6\u8a08\u5bfe\u8c61\u671f\u9593\u3002\u4f55\u65e5\u5206\u306e\u58f2\u4e0a\u3092\u96c6\u8a08\u3059\u308b\u304b\u30021 \u304b\u3089 365\u4ee5\u5185\u3067\u6307\u5b9a\u3002<\/p>\n<p>\u4f8b\uff1a\u6628\u65e5\u306e\u58f2\u4e0a\u3092\u96c6\u8a08\u3057\u307e\u3059\u3002<br \/>\nphp -f execute_batch_daily.php 1 1<\/p>\n<p>USAGE;<\/p>\n<p>if ( $argc != 3 ) {<br \/>\necho ( $usage );<br \/>\nexit(1);<br \/>\n}<\/p>\n<p>$start = $argv[1];<br \/>\n$term = $argv[2];<br \/>\nif ( !is_numeric( $start ) || !is_numeric( $term ) ) {<br \/>\necho ( $usage );<br \/>\nexit(1);<br \/>\n}<\/p>\n<p>$start = intval( $start );<br \/>\n$term = intval( $term );<\/p>\n<p>if ( $start &lt; 1 || $start &gt; 365 || $term &lt; 1 || $term &gt; 365 ) {<br \/>\necho ( $usage );<br \/>\nexit(1);<br \/>\n}<\/p>\n<p>if ( $term &gt; $start ) {<br \/>\necho ( $usage );<br \/>\nexit(1);<br \/>\n}<\/p>\n<p>$objBatch = new SC_Batch_Daily_EX();<br \/>\n$objBatch-&gt;lfStartDailyTotal( $term, $start, true );<br \/>\n?&gt;<\/p><\/blockquote>\n<h3>\u305d\u306e\uff13\uff09\/data\/class\/batch\/SC_Batch_Daily.php\u3092\u4fee\u6b63\u3002<\/h3>\n<p><strong>L92,93\uff08ver.2.3.2\u306e\u5834\u5408\uff09<\/strong><\/p>\n<blockquote><p>\/\/ \u524a\u9664\u3055\u308c\u305f\u53d7\u6ce8\u30c7\u30fc\u30bf\u306e\u53d7\u6ce8\u8a73\u7d30\u60c5\u5831\u306e\u524a\u9664<br \/>\n$objQuery = new SC_Query();<br \/>\n<span style=\"color: #ff00ff;\">\/\/$where = &#8220;order_id IN (SELECT order_id FROM dtb_order WHERE del_flg = 1)&#8221;;\u3000\u2190\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8<br \/>\n\/\/$objQuery-&gt;delete(&#8220;dtb_order_detail&#8221;, $where);\u3000\u2190\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8<\/span><\/p>\n<p>\/\/ \u6700\u5f8c\u306b\u66f4\u65b0\u3055\u308c\u305f\u65e5\u4ed8\u3092\u53d6\u5f97<\/p><\/blockquote>\n<p>\/\/ \u6700\u5f8c\u306b\u66f4\u65b0\u3055\u308c\u305f\u65e5\u4ed8\u3092\u53d6\u5f97<\/p>\n<p><strong>L102(ver.2.3.2\u306e\u5834\u5408\uff09<\/strong><\/p>\n<blockquote><p>\/\/ \u6700\u5f8c\u306e\u30d0\u30c3\u30c1\u5b9f\u884c\u304b\u3089LOAD_BATCH_PASS\u79d2\u7d4c\u904e\u3057\u3066\u3044\u306a\u3044\u3068\u5b9f\u884c\u3057\u306a\u3044\u3002<br \/>\nif($pass &lt; LOAD_BATCH_PASS) {<br \/>\n<span style=\"color: #ff00ff;\">\/\/GC_Utils_Ex::gfPrintLog(&#8220;LAST BATCH &#8221; . $arrRet[0][&#8216;create_date&#8217;] . &#8221; &gt; &#8221; . $batch_pass . &#8221; -&gt; EXIT BATCH $batch_date&#8221;);\u3000\u2190\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8<br \/>\n<strong>$batch_next = date( &#8220;Y-m-d H:i:s&#8221;, strtotime($batch_last) + LOAD_BATCH_PASS );\u3000\u2190\u8ffd\u52a0<br \/>\nGC_Utils_Ex::gfPrintLog(&#8220;LAST BATCH &#8221; . $batch_last . &#8221; NEXT BATCH AFTER $batch_next -&gt; EXIT BATCH&#8221;);\u3000\u2190\u8ffd\u52a0<\/strong><\/span><br \/>\nreturn;<br \/>\n}<\/p><\/blockquote>\n<p><strong>L107(ver.2.3.2\u306e\u5834\u5408\uff09<\/strong><\/p>\n<blockquote><p><span style=\"color: #ff00ff;\">\/\/ \u96c6\u8a08<br \/>\n\/\/for ($i = $start; $i &lt; $term; $i++) {\u3000\u2190\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8<br \/>\n<strong>for ($i = $start, $k = 0; $k &lt; $term; $i&#8211;, $k++ ) {\u3000\u2190\u8ffd\u52a0<\/strong><br \/>\n\/\/ \u57fa\u672c\u6642\u9593\u304b\u3089$i\u65e5\u5206\u3055\u304b\u306e\u307c\u308b<br \/>\n$tmp_time = $now_time &#8211; ($i * 24 * 3600);<\/span><\/p><\/blockquote>\n<p><strong>L154(ver.2.3.2\u306e\u5834\u5408\uff09<\/strong><\/p>\n<blockquote><p>GC_Utils_Ex::gfPrintLog(&#8220;LOADING BATCH $batch_date&#8221;);<br \/>\n$this-&gt;lfBatOrderDaily($tmp_time);<br \/>\n$this-&gt;lfBatOrderDailyHour($tmp_time);<br \/>\n$this-&gt;lfBatOrderAge($tmp_time);<br \/>\n<span style=\"color: #ff00ff;\"><strong>\/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u9632\u3050\u3000\u2190\u8ffd\u52a0<br \/>\nSC_Utils_Ex::sfFlush();\u3000\u2190\u8ffd\u52a0<\/strong><\/span><br \/>\n}<br \/>\n}<\/p><\/blockquote>\n<p>\u203b\u305d\u3082\u305d\u3082\u96c6\u8a08\u6642\u306bSQL\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3068\u3053\u308d\u304c\u3042\u308b\u306e\u3067\u3001\u5148\u306b<br \/>\n<a href=\"http:\/\/www.bton.net46.net\/?p=724\">http:\/\/www.bton.net46.net\/?p=724<\/a><br \/>\n\u306e\u4fee\u6b63\u3092\u884c\u3063\u3066\u304a\u304f\u3053\u3068\u3002<\/p>\n<h3>\u305d\u306e\uff14\uff09CRON\u306e\u8a2d\u5b9a<\/h3>\n<p><span class=\"synConstant\">0<\/span> <span class=\"synConstant\">2<\/span> * * * \/usr\/<span class=\"synStatement\">local<\/span>\/bin\/php <span class=\"synSpecial\">-f<\/span> \/path\/to\/eccube\/data\/script\/execute_batch_daily.php <span class=\"synConstant\">1<\/span> <span class=\"synConstant\">1<\/span> <span class=\"synStatement\">2&gt;&amp;1<\/span> <span class=\"synStatement\">&gt;<\/span> \/dev\/null<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8\uff1a<a href=\"http:\/\/d.hatena.ne.jp\/yuhei_kagaya\/20081019\" target=\"_blank\">http:\/\/d.hatena.ne.jp\/yuhei_kagaya\/20081019<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>EC-CUBE\u306e\u58f2\u308a\u4e0a\u3052\u96c6\u8a08\u306f2\u3064\u306e\u30e2\u30fc\u30c9\u304c\u9078\u629e\u3067\u304d\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306f\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u96c6\u8a08\u3002\u51e6\u7406\u304c\u9577\u304f\u306a\u308b\u3068\u3001\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u3066\u3057\u307e\u3063\u305f\u308a\u3001\u30c0\u30a6\u30f3\u3057\u3066\u3057\u307e\u3046\u3002 \u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\uff65\uff65\uff65\u300c\u6708\u5ea6\u3067\u96c6\u8a08\u3059\u308b\u300d\u3084\u300c\u671f\u9593\u3067\u96c6\u8a08\u3059\u308b\u300d\u30dc\u30bf\u30f3\u304c\u62bc\u3055 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[183],"tags":[147,79,90,163,51],"_links":{"self":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts\/685"}],"collection":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=685"}],"version-history":[{"count":0,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=\/wp\/v2\/posts\/685\/revisions"}],"wp:attachment":[{"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bton.papalabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}