source: temp/branches/mobile/html/mobile/products/detail.php @ 11408

Revision 11408, 14.7 KB checked in by rebelt, 15 years ago (diff)

修正です。

  • Property svn:eol-style set to native
Line 
1<?php
2
3require_once("../require.php");
4require_once(DATA_PATH . "include/page_layout.inc");
5
6class LC_Page {
7    function LC_Page() {
8        /** ɬ¤º»ØÄꤹ¤ë **/
9        global $arrSTATUS;
10        $this->arrSTATUS = $arrSTATUS;
11        global $arrSTATUS_IMAGE;
12        $this->arrSTATUS_IMAGE = $arrSTATUS_IMAGE;
13        global $arrDELIVERYDATE;
14        $this->arrDELIVERYDATE = $arrDELIVERYDATE;
15        global $arrRECOMMEND;
16        $this->arrRECOMMEND = $arrRECOMMEND;
17       
18        $this->tpl_mainpage="products/detail.tpl";
19       
20        /*
21         session_start»þ¤Îno-cache¥Ø¥Ã¥À¡¼¤òÍÞÀ©¤¹¤ë¤³¤È¤Ç
22         ¡ÖÌá¤ë¡×¥Ü¥¿¥ó»ÈÍÑ»þ¤ÎÍ­¸ú´ü¸ÂÀÚ¤ìɽ¼¨¤òÍÞÀ©¤¹¤ë¡£
23         private-no-expire:¥¯¥é¥¤¥¢¥ó¥È¤Î¥­¥ã¥Ã¥·¥å¤òµö²Ä¤¹¤ë¡£
24        */
25        session_cache_limiter('private-no-expire');
26    }
27}
28
29$objPage = new LC_Page();
30$objView = new SC_SiteView();
31$objCustomer = new SC_Customer();
32$objQuery = new SC_Query();
33
34// ¥ì¥¤¥¢¥¦¥È¥Ç¥¶¥¤¥ó¤ò¼èÆÀ
35$objPage = sfGetPageLayout($objPage, false, "products/detail.php");
36
37// ¥Ñ¥é¥á¡¼¥¿´ÉÍý¥¯¥é¥¹
38$objFormParam = new SC_FormParam();
39// ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½
40lfInitParam();
41// POSTÃͤμèÆÀ
42$objFormParam->setParam($_POST);
43
44// ¥Õ¥¡¥¤¥ë´ÉÍý¥¯¥é¥¹
45$objUpFile = new SC_UploadFile(IMAGE_TEMP_DIR, IMAGE_SAVE_DIR);
46// ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½
47lfInitFile();
48
49// ´ÉÍý¥Ú¡¼¥¸¤«¤é¤Î³Îǧ¤Î¾ì¹ç¤Ï¡¢Èó¸ø³«¤Î¾¦Éʤâɽ¼¨¤¹¤ë¡£
50if($_GET['admin'] == 'on') {
51    $where = "del_flg = 0";
52} else {
53    $where = "del_flg = 0 AND status = 1";
54}
55
56if($_POST['mode'] != "") {
57    $tmp_id = $_POST['product_id'];
58} else {
59    $tmp_id = $_GET['product_id'];
60}
61
62// ÃͤÎÀµÅöÀ­¥Á¥§¥Ã¥¯
63if(!sfIsInt($_GET['product_id']) || !sfIsRecord("dtb_products", "product_id", $tmp_id, $where)) {
64    sfDispSiteError(PRODUCT_NOT_FOUND);
65}
66// ¥í¥°¥¤¥óȽÄê
67if($objCustomer->isLoginSuccess()) {
68    //¤ªµ¤¤ËÆþ¤ê¥Ü¥¿¥óɽ¼¨
69    $objPage->tpl_login = true;
70
71/* ±ÜÍ÷¥í¥°µ¡Ç½¤Ï¸½ºß̤»ÈÍÑ
72   
73    $table = "dtb_customer_reading";
74    $where = "customer_id = ? ";
75    $arrval[] = $objCustomer->getValue('customer_id');
76    //¸ÜµÒ¤Î±ÜÍ÷¾¦ÉÊ¿ô
77    $rpcnt = $objQuery->count($table, $where, $arrval);
78
79    //±ÜÍ÷¿ô¤¬ÀßÄê¿ô°Ê²¼
80    if ($rpcnt < CUSTOMER_READING_MAX){
81        //±ÜÍ÷ÍúÎò¤Ë¿·µ¬ÄɲÃ
82        lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id'));
83    } else {
84        //±ÜÍ÷ÍúÎò¤ÎÃæ¤Ç°ìÈָŤ¤¤â¤Î¤òºï½ü¤·¤Æ¿·µ¬ÄɲÃ
85        $oldsql = "SELECT MIN(update_date) FROM ".$table." WHERE customer_id = ?";
86        $old = $objQuery->getone($oldsql, array($objCustomer->getValue("customer_id")));
87        $where = "customer_id = ? AND update_date = ? ";
88        $arrval = array($objCustomer->getValue("customer_id"), $old);
89        //ºï½ü
90        $objQuery->delete($table, $where, $arrval);
91        //ÄɲÃ
92        lfRegistReadingData($tmp_id, $objCustomer->getValue('customer_id'));
93    }
94*/
95}
96
97
98// µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ®
99$objPage = lfMakeSelect($objPage, $tmp_id);
100
101// ¾¦ÉÊID¤òFORMÆâ¤ËÊÝ»ý¤¹¤ë¡£
102$objPage->tpl_product_id = $tmp_id;
103
104switch($_POST['mode']) {
105case 'select':
106    // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
107    if($objPage->tpl_classcat_find1) {
108        // template¤ÎÊѹ¹
109        $objPage->tpl_mainpage = "products/select_find1.tpl";
110        break;
111    }
112
113case 'select2':
114    $objPage->arrErr = lfCheckError();
115
116    // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
117    if($objPage->tpl_classcat_find1 and $objPage->arrErr['classcategory_id1']) {
118        // template¤ÎÊѹ¹
119        $objPage->tpl_mainpage = "products/select_find1.tpl";
120        break;
121    }
122
123    // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
124    if($objPage->tpl_classcat_find2) {
125        $objPage->arrErr = array();
126
127        $objPage->tpl_mainpage = "products/select_find2.tpl";
128        break;
129    }
130
131case 'selectItem':
132    $objPage->arrErr = lfCheckError();
133
134    // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç
135    if($objPage->tpl_classcat_find2 and $objPage->arrErr['classcategory_id2']) {
136        // template¤ÎÊѹ¹
137        $objPage->tpl_mainpage = "products/select_find2.tpl";
138        break;
139    }
140    // ¾¦ÉÊ¿ô¤ÎÁªÂò¤ò¹Ô¤¦
141    $objPage->tpl_mainpage = "products/select_item.tpl";
142    break;
143
144case 'cart':
145    // ÆþÎÏÃͤÎÊÑ´¹
146    $objFormParam->convParam();
147    $objPage->arrErr = lfCheckError();
148    if(count($objPage->arrErr) == 0) {
149        $objCartSess = new SC_CartSession();
150        $classcategory_id1 = $_POST['classcategory_id1'];
151        $classcategory_id2 = $_POST['classcategory_id2'];
152               
153        // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç
154        if(!$objPage->tpl_classcat_find1) {
155            $classcategory_id1 = '0';
156        }
157       
158        // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç
159        if(!$objPage->tpl_classcat_find2) {
160            $classcategory_id2 = '0';
161        }
162       
163        $objCartSess->setPrevURL($_SERVER['REQUEST_URI']);
164        $objCartSess->addProduct(array($_POST['product_id'], $classcategory_id1, $classcategory_id2), $objFormParam->getValue('quantity'));
165
166        header("Location: " . gfAddSessionId(URL_CART_TOP));
167
168        exit;
169    }
170    break;
171       
172default:
173    break;
174}
175
176$objQuery = new SC_Query();
177// DB¤«¤é¾¦ÉʾðÊó¤ò¼èÆÀ¤¹¤ë¡£
178$arrRet = $objQuery->select("*", "vw_products_allclass_detail AS alldtl", "product_id = ?", array($tmp_id));
179$objPage->arrProduct = $arrRet[0];
180
181// ¾¦ÉÊ¥³¡¼¥É¤Î¼èÆÀ
182$code_sql = "SELECT product_code FROM dtb_products_class AS prdcls WHERE prdcls.product_id = ? GROUP BY product_code ORDER BY product_code";
183$arrProductCode = $objQuery->getall($code_sql, array($tmp_id));
184$arrProductCode = sfswaparray($arrProductCode);
185$objPage->arrProductCode = $arrProductCode["product_code"];
186
187// ¹ØÆþÀ©¸Â¿ô¤ò¼èÆÀ
188if($objPage->arrProduct['sale_unlimited'] == 1 || $objPage->arrProduct['sale_limit'] > SALE_LIMIT_MAX) {
189  $objPage->tpl_sale_limit = SALE_LIMIT_MAX;
190} else {
191  $objPage->tpl_sale_limit = $objPage->arrProduct['sale_limit'];
192}
193
194// ¥µ¥Ö¥¿¥¤¥È¥ë¤ò¼èÆÀ
195$arrFirstCat = GetFirstCat($arrRet[0]['category_id']);
196$tpl_subtitle = $arrFirstCat['name'];
197$objPage->tpl_subtitle = $tpl_subtitle;
198
199// DB¤«¤é¤Î¥Ç¡¼¥¿¤ò°ú¤­·Ñ¤°
200$objUpFile->setDBFileList($objPage->arrProduct);
201// ¥Õ¥¡¥¤¥ëɽ¼¨ÍÑÇÛÎó¤òÅϤ¹
202$objPage->arrFile = $objUpFile->getFormFileList(IMAGE_TEMP_URL, IMAGE_SAVE_URL, true);
203// »ÙʧÊýË¡¤Î¼èÆÀ
204$objPage->arrPayment = lfGetPayment();
205// ÆþÎϾðÊó¤òÅϤ¹
206$objPage->arrForm = $objFormParam->getFormParamList();
207//¥ì¥Ó¥å¡¼¾ðÊó¤Î¼èÆÀ
208$objPage->arrReview = lfGetReviewData($tmp_id);
209// ¥¿¥¤¥È¥ë¤Ë¾¦ÉÊ̾¤òÆþ¤ì¤ë
210$objPage->tpl_title = "¾¦Éʾܺ٠". $objPage->arrProduct["name"];
211//¥ª¥¹¥¹¥á¾¦ÉʾðÊóɽ¼¨
212$objPage->arrRecommend = lfPreGetRecommendProducts($tmp_id);
213//¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹
214$objPage->arrRelateProducts = lfGetRelateProducts($tmp_id);
215
216// ³ÈÂç²èÁü¤Î¥¦¥£¥ó¥É¥¦¥µ¥¤¥º¤ò¥»¥Ã¥È
217list($large_width, $large_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrFile["main_large_image"]["filepath"]));
218$objPage->tpl_large_width = $large_width + 60;
219$objPage->tpl_large_height = $large_height + 80;
220
221$objView->assignobj($objPage);
222$objView->display(SITE_FRAME);
223//-----------------------------------------------------------------------------------------------------------------------------------
224/* ¥Õ¥¡¥¤¥ë¾ðÊó¤Î½é´ü²½ */
225function lfInitFile() {
226    global $objUpFile;
227    $objUpFile->addFile("°ìÍ÷-¥á¥¤¥ó²èÁü", 'main_list_image', array('jpg','gif'),IMAGE_SIZE, true, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
228    $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó²èÁü", 'main_image', array('jpg'), IMAGE_SIZE, true, NORMAL_IMAGE_WIDTH, NORMAL_IMAGE_HEIGHT);
229    $objUpFile->addFile("¾ÜºÙ-¥á¥¤¥ó³ÈÂç²èÁü", 'main_large_image', array('jpg'), IMAGE_SIZE, false, LARGE_IMAGE_HEIGHT, LARGE_IMAGE_HEIGHT);
230    for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
231        $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö²èÁü$cnt", "sub_image$cnt", array('jpg'), IMAGE_SIZE, false, NORMAL_SUBIMAGE_HEIGHT, NORMAL_SUBIMAGE_HEIGHT);
232        $objUpFile->addFile("¾ÜºÙ-¥µ¥Ö³ÈÂç²èÁü$cnt", "sub_large_image$cnt", array('jpg'), IMAGE_SIZE, false, LARGE_SUBIMAGE_HEIGHT, LARGE_SUBIMAGE_HEIGHT);
233    }
234    $objUpFile->addFile("¾¦ÉÊÈæ³Ó²èÁü", 'file1', array('jpg'), IMAGE_SIZE, false, NORMAL_IMAGE_HEIGHT, NORMAL_IMAGE_HEIGHT);
235    $objUpFile->addFile("¾¦Éʾܺ٥ե¡¥¤¥ë", 'file2', array('pdf'), PDF_SIZE, false, 0, 0, false);
236}
237
238/* µ¬³ÊÁªÂò¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹¤ÎºîÀ® */
239function lfMakeSelect($objPage, $product_id) {
240    global $objPage;
241    $classcat_find1 = false;
242    $classcat_find2 = false;
243    // ºß¸Ë¤¢¤ê¤Î¾¦ÉʤÎ̵ͭ
244    $stock_find = false;
245   
246    // µ¬³Ê̾°ìÍ÷
247    $arrClassName = sfGetIDValueList("dtb_class", "class_id", "name");
248    // µ¬³ÊʬÎà̾°ìÍ÷
249    $arrClassCatName = sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
250    // ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ   
251    $arrProductsClass = lfGetProductsClass($product_id);
252   
253    // µ¬³Ê1¥¯¥é¥¹Ì¾¤Î¼èÆÀ
254    $objPage->tpl_class_name1 = $arrClassName[$arrProductsClass[0]['class_id1']];
255    // µ¬³Ê2¥¯¥é¥¹Ì¾¤Î¼èÆÀ
256    $objPage->tpl_class_name2 = $arrClassName[$arrProductsClass[0]['class_id2']];
257   
258    // ¤¹¤Ù¤Æ¤ÎÁȤ߹ç¤ï¤»¿ô
259    $count = count($arrProductsClass);
260   
261    $classcat_id1 = "";
262   
263    $arrSele1 = array();
264    $arrSele2 = array();
265    $arrList = array();
266   
267    $list_id = 0;
268    $arrList[0] = "\tlist0 = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤'";
269    $arrVal[0] = "\tval0 = new Array(''";
270   
271    for ($i = 0; $i < $count; $i++) {
272        // ºß¸Ë¤Î¥Á¥§¥Ã¥¯
273        if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') {
274            continue;
275        }
276       
277        $stock_find = true;
278       
279        // µ¬³Ê1¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ
280        if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){
281            $arrList[$list_id].=");\n";
282            $arrVal[$list_id].=");\n";
283            $classcat_id1 = $arrProductsClass[$i]['classcategory_id1'];
284            $arrSele1[$classcat_id1] = $arrClassCatName[$classcat_id1];
285        }
286
287        // µ¬³Ê2¤Î¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹ÍÑ
288        if($arrProductsClass[$i]['classcategory_id1'] == $_POST['classcategory_id1'] and $classcat_id2 != $arrProductsClass[$i]['classcategory_id2']) {
289            $classcat_id2 = $arrProductsClass[$i]['classcategory_id2'];
290            $arrSele2[$classcat_id2] = $arrClassCatName[$classcat_id2];
291        }
292
293        $list_id++;
294
295        // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹É½¼¨ÃÍ
296        if($arrList[$list_id] == "") {
297            $arrList[$list_id] = "\tlist".$list_id." = new Array('ÁªÂò¤·¤Æ¤¯¤À¤µ¤¤', '".$arrClassCatName[$classcat_id2]."'";
298        } else {
299            $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'";
300        }
301       
302        // ¥»¥ì¥¯¥È¥Ü¥Ã¥¯¥¹POSTÃÍ
303        if($arrVal[$list_id] == "") {
304            $arrVal[$list_id] = "\tval".$list_id." = new Array('', '".$classcat_id2."'";
305        } else {
306            $arrVal[$list_id].= ", '".$classcat_id2."'";
307        }
308    }   
309   
310    //$arrList[$list_id].=");\n";
311    $arrVal[$list_id].=");\n";
312       
313    // µ¬³Ê1
314    $objPage->arrClassCat1 = $arrSele1;
315    $objPage->arrClassCat2 = $arrSele2;
316   
317    //$lists = "\tlists = new Array(";
318    //$no = 0;
319   
320    //foreach($arrList as $val) {
321    //  $objPage->tpl_javascript.= $val;
322    //  if ($no != 0) {
323    //      $lists.= ",list".$no;
324    //  } else {
325    //      $lists.= "list".$no;
326    //  }
327    //  $no++;
328    //}
329    //$objPage->tpl_javascript.=$lists.");\n";
330   
331    $vals = "\tvals = new Array(";
332    $no = 0;
333   
334    //foreach($arrVal as $val) {
335    //  $objPage->tpl_javascript.= $val;
336    //  if ($no != 0) {
337    //      $vals.= ",val".$no;
338    //  } else {
339    //      $vals.= "val".$no;
340    //  }
341    //  $no++;
342    //}
343    //$objPage->tpl_javascript.=$vals.");\n";
344   
345    // ÁªÂò¤µ¤ì¤Æ¤¤¤ëµ¬³Ê2ID
346    $objPage->tpl_onload = "lnSetSelect('form1', 'classcategory_id1', 'classcategory_id2', '" . $_POST['classcategory_id2'] . "');";
347
348    // µ¬³Ê1¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
349    if($arrProductsClass[0]['classcategory_id1'] != '0') {
350        $classcat_find1 = true;
351    }
352   
353    // µ¬³Ê2¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë
354    if($arrProductsClass[0]['classcategory_id2'] != '0') {
355        $classcat_find2 = true;
356    }
357       
358    $objPage->tpl_classcat_find1 = $classcat_find1;
359    $objPage->tpl_classcat_find2 = $classcat_find2;
360    $objPage->tpl_stock_find = $stock_find;
361       
362    return $objPage;
363}
364
365/* ¥Ñ¥é¥á¡¼¥¿¾ðÊó¤Î½é´ü²½ */
366function lfInitParam() {
367    global $objFormParam;
368
369    $objFormParam->addParam("µ¬³Ê1", "classcategory_id1", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
370    $objFormParam->addParam("µ¬³Ê2", "classcategory_id2", INT_LEN, "n", array("NUM_CHECK", "MAX_LENGTH_CHECK"));
371    $objFormParam->addParam("¸Ä¿ô", "quantity", INT_LEN, "n", array("EXIST_CHECK", "ZERO_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
372}
373
374/* ¾¦Éʵ¬³Ê¾ðÊó¤Î¼èÆÀ */
375function lfGetProductsClass($product_id) {
376    $arrRet = array();
377    if(sfIsInt($product_id)) {
378        // ¾¦Éʵ¬³Ê¼èÆÀ
379        $objQuery = new SC_Query();
380        $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited";
381        $table = "vw_product_class AS prdcls";
382        $where = "product_id = ?";
383        $objQuery->setorder("rank1 DESC, rank2 DESC");
384        $arrRet = $objQuery->select($col, $table, $where, array($product_id));
385    }
386    return $arrRet;
387}
388
389/* ÅÐÏ¿ºÑ¤ß¥ª¥¹¥¹¥á¾¦ÉʤÎÆɤ߹þ¤ß */
390function lfPreGetRecommendProducts($product_id) {
391    $objQuery = new SC_Query();
392    $objQuery->setorder("rank DESC");
393    $arrRet = $objQuery->select("recommend_product_id, comment", "dtb_recommend_products", "product_id = ?", array($product_id));
394    $max = count($arrRet);
395    $no = 0;
396    for($i = 0; $i < $max; $i++) {
397        $where = "del_flg = 0 AND product_id = ? AND status = 1";
398        $arrProductInfo = $objQuery->select("main_list_image, price02_min, price02_max, price01_min, price01_max, name, point_rate", "vw_products_allclass  AS allcls", $where, array($arrRet[$i]['recommend_product_id']));
399               
400        if(count($arrProductInfo) > 0) {
401            $arrRecommend[$no] = $arrProductInfo[0];
402            $arrRecommend[$no]['product_id'] = $arrRet[$i]['recommend_product_id'];
403            $arrRecommend[$no]['comment'] = $arrRet[$i]['comment'];
404            $no++;
405        }   
406    }
407    return $arrRecommend;
408}
409
410/* ÆþÎÏÆâÍƤΥÁ¥§¥Ã¥¯ */
411function lfCheckError() {
412    global $objFormParam;
413    global $objPage;
414    // ÆþÎϥǡ¼¥¿¤òÅϤ¹¡£
415    $arrRet =  $objFormParam->getHashArray();
416    $objErr = new SC_CheckError($arrRet);
417    $objErr->arrErr = $objFormParam->checkError();
418       
419    // Ê£¿ô¹àÌÜ¥Á¥§¥Ã¥¯
420    if ($objPage->tpl_classcat_find1) {
421        $objErr->doFunc(array("µ¬³Ê1", "classcategory_id1"), array("EXIST_CHECK"));
422    }
423    if ($objPage->tpl_classcat_find2) {
424        $objErr->doFunc(array("µ¬³Ê2", "classcategory_id2"), array("EXIST_CHECK"));
425    }
426
427    return $objErr->arrErr;
428}
429
430//±ÜÍ÷ÍúÎò¿·µ¬ÅÐÏ¿
431function lfRegistReadingData($tmp_id, $customer_id){
432    $objQuery = new SC_Query;
433    $sqlval['customer_id'] = $customer_id;
434    $sqlval['reading_product_id'] = $tmp_id;
435    $sqlval['create_date'] = 'NOW()';
436    $sqlval['update_date'] = 'NOW()';
437    $objQuery->insert("dtb_customer_reading", $sqlval);
438}
439
440//¤³¤Î¾¦ÉʤòÇã¤Ã¤¿¿Í¤Ï¤³¤ó¤Ê¾¦ÉʤâÇã¤Ã¤Æ¤¤¤Þ¤¹
441function lfGetRelateProducts($tmp_id) {
442    $objQuery = new SC_Query;
443    //¼«Æ°Ãê½Ð
444    $objQuery->setorder("random()");
445    //ɽ¼¨·ï¿ô¤ÎÀ©¸Â
446    $objQuery->setlimit(RELATED_PRODUCTS_MAX);
447    //¸¡º÷¾ò·ï
448    $col = "name, main_list_image, price01_min, price02_min, price01_max, price02_max, point_rate";
449    $from = "vw_products_allclass AS allcls ";
450    $where = "del_flg = 0 AND status = 1 AND (stock_max <> 0 OR stock_max IS NULL) AND product_id = ? ";
451    $arrval[] = $tmp_id;
452    //·ë²Ì¤Î¼èÆÀ
453    $arrProducts = $objQuery->select($col, $from, $where, $arrval);
454   
455    return $arrProducts;
456}
457
458//¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë
459function lfGetReviewData($id) {
460    $objQuery = new SC_Query;
461    //¾¦Éʤ´¤È¤Î¥ì¥Ó¥å¡¼¾ðÊó¤ò¼èÆÀ¤¹¤ë
462    $col = "create_date, reviewer_url, reviewer_name, recommend_level, title, comment";
463    $from = "dtb_review";
464    $where = "del_flg = 0 AND status = 1 AND product_id = ? ";
465    $arrval[] = $id;
466    $arrReview = $objQuery->select($col, $from, $where, $arrval);
467    return $arrReview;
468}
469
470//»ÙʧÊýË¡¤Î¼èÆÀ
471//payment_id    1:¥¯¥ì¥¸¥Ã¥È¡¡2:¥·¥ç¥Ã¥Ô¥ó¥°¥í¡¼¥ó 
472function lfGetPayment() {
473    $objQuery = new SC_Query;
474    $col = "payment_id, rule, payment_method";
475    $from = "dtb_payment";
476    $where = "del_flg = 0";
477    $order = "payment_id";
478    $objQuery->setorder($order);
479    $arrRet = $objQuery->select($col, $from, $where);
480    return $arrRet;
481}
482?>
Note: See TracBrowser for help on using the repository browser.