- Timestamp:
- 2013/05/02 18:11:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/mypage/LC_Page_Mypage_Favorite.php
r22567 r22796 32 32 * @version $Id$ 33 33 */ 34 class LC_Page_MyPage_Favorite extends LC_Page_AbstractMypage_Ex 35 { 34 class LC_Page_MyPage_Favorite extends LC_Page_AbstractMypage_Ex { 36 35 37 36 // {{{ properties … … 48 47 * @return void 49 48 */ 50 function init() 51 { 49 function init() { 52 50 parent::init(); 53 51 $this->tpl_subtitle = 'お気に入り一覧'; … … 60 58 * @return void 61 59 */ 62 function process() 63 { 60 function process() { 64 61 parent::process(); 65 62 } … … 70 67 * @return void 71 68 */ 72 function action() 73 { 69 function action() { 70 71 $objProduct = new SC_Product_Ex(); 74 72 $objCustomer = new SC_Customer_Ex(); 75 76 73 $customer_id = $objCustomer->getValue('customer_id'); 77 74 … … 81 78 $this->lfDeleteFavoriteProduct($customer_id, intval($_POST['product_id'])); 82 79 break; 83 84 80 case 'getList': 85 81 // スマートフォン版のもっと見るボタン用 … … 89 85 } 90 86 $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); 91 SC_Product_Ex::setPriceTaxTo($this->arrFavorite); 87 $this->arrFavorite = $objProduct->setPriceTaxTo($this->arrFavorite); 88 92 89 93 90 echo SC_Utils_Ex::jsonEncode($this->arrFavorite); 94 91 SC_Response_Ex::actionExit(); 95 break;96 97 default:98 92 break; 99 93 } … … 115 109 * @return void 116 110 */ 117 function destroy() 118 { 111 function destroy() { 119 112 parent::destroy(); 120 113 } … … 128 121 * @return array お気に入り商品一覧 129 122 */ 130 function lfGetFavoriteProduct($customer_id, &$objPage) 131 { 123 function lfGetFavoriteProduct($customer_id, &$objPage) { 132 124 $objQuery = SC_Query_Ex::getSingletonInstance(); 133 125 $objProduct = new SC_Product_Ex(); 134 126 135 $objQuery->setOrder(' f.create_date DESC');136 $where = ' f.customer_id = ? and p.status = 1';127 $objQuery->setOrder('create_date DESC'); 128 $where = 'customer_id = ?'; 137 129 if (NOSTOCK_HIDDEN) { 138 130 $where .= ' AND EXISTS(SELECT * FROM dtb_products_class WHERE product_id = dtb_customer_favorite_products.product_id AND del_flg = 0 AND (stock >= 1 OR stock_unlimited = 1))'; 139 131 } 140 $arrProductId = $objQuery->getCol(' f.product_id', 'dtb_customer_favorite_products f inner join dtb_products p using (product_id)', $where, array($customer_id));132 $arrProductId = $objQuery->getCol('product_id', 'dtb_customer_favorite_products', $where, array($customer_id)); 141 133 142 134 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 178 170 179 171 /* 仕方がない処理。。 */ 180 function lfMakeWhere($tablename, $arrProductId) 181 { 172 function lfMakeWhere($tablename, $arrProductId) { 182 173 183 174 // 取得した表示すべきIDだけを指定して情報を取得。 … … 193 184 194 185 // お気に入り商品削除 195 function lfDeleteFavoriteProduct($customer_id, $product_id) 196 { 186 function lfDeleteFavoriteProduct($customer_id, $product_id) { 197 187 $objQuery =& SC_Query_Ex::getSingletonInstance(); 198 188
Note: See TracChangeset
for help on using the changeset viewer.