Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
13 changed files
with
162 additions
and
125 deletions
@@ -22,16 +22,13 @@ class Yohobuy | @@ -22,16 +22,13 @@ class Yohobuy | ||
22 | // const API_URL2 = 'http://api.open.yohobuy.com/'; | 22 | // const API_URL2 = 'http://api.open.yohobuy.com/'; |
23 | // const SERVICE_URL = 'http://service.api.yohobuy.com/'; | 23 | // const SERVICE_URL = 'http://service.api.yohobuy.com/'; |
24 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 24 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
25 | + // const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/'; | ||
25 | 26 | ||
26 | /* 测试环境 */ | 27 | /* 测试环境 */ |
27 | const API_URL = 'http://testapi.yoho.cn:28078/'; | 28 | const API_URL = 'http://testapi.yoho.cn:28078/'; |
28 | const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; | 29 | const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; |
29 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 30 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
30 | - const YOHOBUY_ORDER = 'http://192.168.102.209:8084/order/'; //我的订单 | ||
31 | - const API_URL_MYCENTER = 'http://192.168.102.207:8081/users/'; // 我的个人中心接口URL | ||
32 | - const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL | ||
33 | - const API_URL_PRODUCTDETAIL = 'http://192.168.102.212:8083/product/'; // 商品详情页 | ||
34 | - const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL | 31 | + const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/'; |
35 | 32 | ||
36 | /** | 33 | /** |
37 | * 私钥列表 | 34 | * 私钥列表 |
@@ -59,7 +59,6 @@ class OrderData | @@ -59,7 +59,6 @@ class OrderData | ||
59 | * To change this template file, choose Tools | Templates | 59 | * To change this template file, choose Tools | Templates |
60 | * and open the template in the editor. | 60 | * and open the template in the editor. |
61 | */ | 61 | */ |
62 | - | ||
63 | public static function deleteOrderData($order_code, $uid, $gender, $yh_channel) | 62 | public static function deleteOrderData($order_code, $uid, $gender, $yh_channel) |
64 | { | 63 | { |
65 | //构建必传参数 | 64 | //构建必传参数 |
@@ -94,7 +93,7 @@ class OrderData | @@ -94,7 +93,7 @@ class OrderData | ||
94 | } | 93 | } |
95 | 94 | ||
96 | /* | 95 | /* |
97 | - * 支付url | 96 | + * 支付页面的资源位 |
98 | * To change this template file, choose Tools | Templates | 97 | * To change this template file, choose Tools | Templates |
99 | */ | 98 | */ |
100 | public static function paymentData($gender, $yh_channel, $code) | 99 | public static function paymentData($gender, $yh_channel, $code) |
1 | <?php | 1 | <?php |
2 | + | ||
2 | namespace LibModels\Wap\Passport; | 3 | namespace LibModels\Wap\Passport; |
3 | 4 | ||
4 | use Api\Sign; | 5 | use Api\Sign; |
@@ -15,7 +16,7 @@ use Api\Yohobuy; | @@ -15,7 +16,7 @@ use Api\Yohobuy; | ||
15 | */ | 16 | */ |
16 | class LoginData | 17 | class LoginData |
17 | { | 18 | { |
18 | - | 19 | + |
19 | /** | 20 | /** |
20 | * 登录 | 21 | * 登录 |
21 | * | 22 | * |
@@ -32,10 +33,10 @@ class LoginData | @@ -32,10 +33,10 @@ class LoginData | ||
32 | $param['profile'] = $profile; | 33 | $param['profile'] = $profile; |
33 | $param['password'] = $password; | 34 | $param['password'] = $password; |
34 | $param['client_secret'] = Sign::getSign($param); | 35 | $param['client_secret'] = Sign::getSign($param); |
35 | - | 36 | + |
36 | return Yohobuy::post(Yohobuy::API_URL, $param); | 37 | return Yohobuy::post(Yohobuy::API_URL, $param); |
37 | } | 38 | } |
38 | - | 39 | + |
39 | /** | 40 | /** |
40 | * 用户信息 | 41 | * 用户信息 |
41 | * | 42 | * |
@@ -48,7 +49,7 @@ class LoginData | @@ -48,7 +49,7 @@ class LoginData | ||
48 | $param['method'] = 'app.passport.profile'; | 49 | $param['method'] = 'app.passport.profile'; |
49 | $param['uid'] = $uid; | 50 | $param['uid'] = $uid; |
50 | $param['client_secret'] = Sign::getSign($param); | 51 | $param['client_secret'] = Sign::getSign($param); |
51 | - | 52 | + |
52 | return Yohobuy::get(Yohobuy::API_URL, $param); | 53 | return Yohobuy::get(Yohobuy::API_URL, $param); |
53 | } | 54 | } |
54 | 55 | ||
@@ -68,7 +69,38 @@ class LoginData | @@ -68,7 +69,38 @@ class LoginData | ||
68 | $param['openId'] = $openId; | 69 | $param['openId'] = $openId; |
69 | $param['source_type'] = $sourceType; | 70 | $param['source_type'] = $sourceType; |
70 | $param['client_secret'] = Sign::getSign($param); | 71 | $param['client_secret'] = Sign::getSign($param); |
71 | - | 72 | + |
72 | return Yohobuy::get(Yohobuy::API_URL, $param); | 73 | return Yohobuy::get(Yohobuy::API_URL, $param); |
73 | } | 74 | } |
75 | + | ||
76 | + /** | ||
77 | + * 写入SESSION会话 | ||
78 | + * | ||
79 | + * @param int $uid 用户ID | ||
80 | + * @return array | ||
81 | + */ | ||
82 | + public static function signinSession($uid) | ||
83 | + { | ||
84 | + $param = array(); | ||
85 | + $param['uid'] = $uid; | ||
86 | + $param['token'] = md5($uid . '#@!@#'); | ||
87 | + | ||
88 | + return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/index', $param); | ||
89 | + } | ||
90 | + | ||
91 | + /** | ||
92 | + * 写入SESSION会话 | ||
93 | + * | ||
94 | + * @param int $uid 用户ID | ||
95 | + * @return array | ||
96 | + */ | ||
97 | + public static function checkSession($uid) | ||
98 | + { | ||
99 | + $param = array(); | ||
100 | + $param['uid'] = $uid; | ||
101 | + $param['token'] = md5($uid . '#@!@#'); | ||
102 | + | ||
103 | + return Yohobuy::get(Yohobuy::API_URL_LOGINSESSION . 'Passport/session/val', $param); | ||
104 | + } | ||
105 | + | ||
74 | } | 106 | } |
@@ -31,9 +31,13 @@ class DetailData | @@ -31,9 +31,13 @@ class DetailData | ||
31 | */ | 31 | */ |
32 | public static function baseInfo($productId, $uid) | 32 | public static function baseInfo($productId, $uid) |
33 | { | 33 | { |
34 | - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array( | ||
35 | - 'param' => intval($productId), 'userId' => intval($uid) | ||
36 | - )); | 34 | + $param = Yohobuy::param(); |
35 | + $param['method'] = 'h5.product.data'; | ||
36 | + $param['product_id'] = $productId; | ||
37 | + $param['uid'] = $uid; | ||
38 | + $param['client_secret'] = Sign::getSign($param); | ||
39 | + | ||
40 | + return Yohobuy::post(Yohobuy::API_URL, $param); | ||
37 | } | 41 | } |
38 | 42 | ||
39 | /** | 43 | /** |
@@ -44,7 +48,12 @@ class DetailData | @@ -44,7 +48,12 @@ class DetailData | ||
44 | */ | 48 | */ |
45 | public static function sizeInfo($productSkn) | 49 | public static function sizeInfo($productSkn) |
46 | { | 50 | { |
47 | - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn))); | 51 | + $param = Yohobuy::param(); |
52 | + $param['method'] = 'h5.product.intro'; | ||
53 | + $param['productskn'] = $productSkn; | ||
54 | + $param['client_secret'] = Sign::getSign($param); | ||
55 | + | ||
56 | + return Yohobuy::post(Yohobuy::API_URL, $param); | ||
48 | } | 57 | } |
49 | 58 | ||
50 | /** | 59 | /** |
@@ -57,11 +66,14 @@ class DetailData | @@ -57,11 +66,14 @@ class DetailData | ||
57 | */ | 66 | */ |
58 | public static function consultList($productId, $pageNum, $pageSize) | 67 | public static function consultList($productId, $pageNum, $pageSize) |
59 | { | 68 | { |
60 | - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_CONSULT_LIST, array( | ||
61 | - 'productId' => intval($productId), | ||
62 | - 'pageNum' => intval($pageNum), | ||
63 | - 'pageSize' => intval($pageSize), | ||
64 | - )); | 69 | + $param = Yohobuy::param(); |
70 | + $param['method'] = 'h5.consult.li'; | ||
71 | + $param['product_id'] = $productId; | ||
72 | + $param['page'] = $pageNum; | ||
73 | + $param['limit'] = $pageSize; | ||
74 | + $param['client_secret'] = Sign::getSign($param); | ||
75 | + | ||
76 | + return Yohobuy::post(Yohobuy::API_URL, $param); | ||
65 | } | 77 | } |
66 | 78 | ||
67 | /** | 79 | /** |
@@ -74,25 +86,22 @@ class DetailData | @@ -74,25 +86,22 @@ class DetailData | ||
74 | */ | 86 | */ |
75 | public static function commentList($productId, $pageNum, $pageSize) | 87 | public static function commentList($productId, $pageNum, $pageSize) |
76 | { | 88 | { |
77 | - return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_COMMENT_LIST, array( | ||
78 | - 'productId' => intval($productId), | ||
79 | - 'pageNum' => intval($pageNum), | ||
80 | - 'pageSize' => intval($pageSize), | ||
81 | - )); | 89 | + // 暂未提供提口 |
82 | } | 90 | } |
83 | 91 | ||
84 | /** | 92 | /** |
85 | * 为你优选的商品列表 | 93 | * 为你优选的商品列表 |
86 | * | 94 | * |
87 | - * @todo 需要替换成JAVA接口 | ||
88 | * @param int $productSkn 商品SKN号 | 95 | * @param int $productSkn 商品SKN号 |
89 | * @return array | 96 | * @return array |
90 | */ | 97 | */ |
91 | - public static function preference($productSkn) | 98 | + public static function preference($productSkn, $channel, $brandId) |
92 | { | 99 | { |
93 | $param = Yohobuy::param(); | 100 | $param = Yohobuy::param(); |
94 | - $param['method'] = 'app.product.topreference'; | ||
95 | - $param['product_skn'] = $productSkn; | 101 | + $param['method'] = 'h5.preference.Search'; |
102 | + $param['productskn'] = $productSkn; | ||
103 | + $param['yhchannel'] = $channel; | ||
104 | + $param['brandId'] = $brandId; | ||
96 | $param['client_secret'] = Sign::getSign($param); | 105 | $param['client_secret'] = Sign::getSign($param); |
97 | 106 | ||
98 | return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时 | 107 | return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时 |
@@ -108,7 +117,7 @@ class DetailData | @@ -108,7 +117,7 @@ class DetailData | ||
108 | public static function addConsult($uid, $productId, $content) | 117 | public static function addConsult($uid, $productId, $content) |
109 | { | 118 | { |
110 | $param = Yohobuy::param(); | 119 | $param = Yohobuy::param(); |
111 | - $param['method'] = 'app.consult.add'; | 120 | + $param['method'] = 'h5.consult.add'; |
112 | $param['product_id'] = $productId; | 121 | $param['product_id'] = $productId; |
113 | $param['content'] = $content; | 122 | $param['content'] = $content; |
114 | $param['uid'] = $uid; | 123 | $param['uid'] = $uid; |
@@ -95,9 +95,9 @@ class NewsaleData | @@ -95,9 +95,9 @@ class NewsaleData | ||
95 | }); | 95 | }); |
96 | 96 | ||
97 | $param = Yohobuy::param(); | 97 | $param = Yohobuy::param(); |
98 | - if(!is_null($dayLimit)) { | 98 | + if (!is_null($dayLimit)) { |
99 | $param['method'] = 'app.search.newProduct'; | 99 | $param['method'] = 'app.search.newProduct'; |
100 | - }else { | 100 | + } else { |
101 | $param['method'] = 'app.search.sales'; | 101 | $param['method'] = 'app.search.sales'; |
102 | } | 102 | } |
103 | $param['page'] = $page; | 103 | $param['page'] = $page; |
@@ -178,30 +178,29 @@ class NewsaleData | @@ -178,30 +178,29 @@ class NewsaleData | ||
178 | return Yohobuy::get(Yohobuy::API_URL, $param); | 178 | return Yohobuy::get(Yohobuy::API_URL, $param); |
179 | } | 179 | } |
180 | 180 | ||
181 | + /** | ||
182 | + * 获取热销排行榜商品数据 | ||
183 | + * | ||
184 | + * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 | ||
185 | + * @param string|null $sort 品类ID查询参数 | ||
186 | + * @param integer|null $tab_id Tab的ID | ||
187 | + * @param integer $limit 查询返回的最大限制数, 默认为50 | ||
188 | + * @param integer $page 分页第几页, 默认第1页 | ||
189 | + * @return array 新品到着商品数据 | ||
190 | + */ | ||
191 | + public static function getTopProducts($gender, $sort = null, $tab_id = null, $limit = 50, $page = 1) | ||
192 | + { | ||
193 | + $param = Yohobuy::param(); | ||
194 | + $param['method'] = 'app.search.top'; | ||
195 | + $param['gender'] = $gender; | ||
196 | + !empty($sort) && $param['sort'] = $sort; | ||
197 | + !empty($tab_id) && $param['tab_id'] = $tab_id; | ||
198 | + $param['page'] = $page; | ||
199 | + $param['limit'] = $limit; | ||
200 | + | ||
201 | + $param['client_secret'] = Sign::getSign($param); | ||
181 | 202 | ||
182 | - /** | ||
183 | - * 获取热销排行榜商品数据 | ||
184 | - * | ||
185 | - * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 | ||
186 | - * @param string|null $sort 品类ID查询参数 | ||
187 | - * @param integer|null $tab_id Tab的ID | ||
188 | - * @param integer $limit 查询返回的最大限制数, 默认为50 | ||
189 | - * @param integer $page 分页第几页, 默认第1页 | ||
190 | - * @return array 新品到着商品数据 | ||
191 | - */ | ||
192 | - public static function getTopProducts($gender, $sort = null, $tab_id = null, $limit = 50, $page = 1) | ||
193 | - { | ||
194 | - $param = Yohobuy::param(); | ||
195 | - $param['method'] = 'app.search.top'; | ||
196 | - $param['gender'] = $gender; | ||
197 | - !empty($sort) && $param['sort'] = $sort; | ||
198 | - !empty($tab_id) && $param['tab_id'] = $tab_id; | ||
199 | - $param['page'] = $page; | ||
200 | - $param['limit'] = $limit; | ||
201 | - | ||
202 | - $param['client_secret'] = Sign::getSign($param); | ||
203 | - | ||
204 | - return Yohobuy::get(Yohobuy::API_URL, $param); | ||
205 | - } | 203 | + return Yohobuy::get(Yohobuy::API_URL, $param); |
204 | + } | ||
206 | 205 | ||
207 | } | 206 | } |
@@ -683,6 +683,7 @@ class HomeController extends AbstractAction | @@ -683,6 +683,7 @@ class HomeController extends AbstractAction | ||
683 | $order['walkwayUrl'] = Helpers::url('/product/new'); | 683 | $order['walkwayUrl'] = Helpers::url('/product/new'); |
684 | } else { | 684 | } else { |
685 | echo ' '; | 685 | echo ' '; |
686 | + exit(); | ||
686 | } | 687 | } |
687 | 688 | ||
688 | //渲染模板 | 689 | //渲染模板 |
@@ -23,7 +23,7 @@ class OrderModel | @@ -23,7 +23,7 @@ class OrderModel | ||
23 | { | 23 | { |
24 | $result = array(); | 24 | $result = array(); |
25 | //调用接口获得数据 | 25 | //调用接口获得数据 |
26 | - $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid); | 26 | + $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 5772257); var_dump($data); exit; |
27 | // 判断是否还有数据, 没有数据则返回空 | 27 | // 判断是否还有数据, 没有数据则返回空 |
28 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { | 28 | if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { |
29 | return $result; | 29 | return $result; |
@@ -33,7 +33,7 @@ class OrderModel | @@ -33,7 +33,7 @@ class OrderModel | ||
33 | foreach ($data['data']['order_list'] as $key => $vo) { | 33 | foreach ($data['data']['order_list'] as $key => $vo) { |
34 | //订单号,支付状态,订单商品数量,订单总价格 | 34 | //订单号,支付状态,订单商品数量,订单总价格 |
35 | $result[$key]['orderNum'] = $vo['order_code']; | 35 | $result[$key]['orderNum'] = $vo['order_code']; |
36 | - $result[$key]['orderStatus'] = $vo['status_str']; | 36 | + $result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $vo['status_str']; |
37 | $result[$key]['count'] = count($vo['order_goods']); | 37 | $result[$key]['count'] = count($vo['order_goods']); |
38 | $result[$key]['sumCost'] = $vo['amount']; | 38 | $result[$key]['sumCost'] = $vo['amount']; |
39 | //类内调用格式化订单商品数据方法 | 39 | //类内调用格式化订单商品数据方法 |
@@ -96,8 +96,8 @@ class DetailModel | @@ -96,8 +96,8 @@ class DetailModel | ||
96 | if (isset($baseInfo['promotionBoList'])) { | 96 | if (isset($baseInfo['promotionBoList'])) { |
97 | $build = array(); | 97 | $build = array(); |
98 | foreach ($baseInfo['promotionBoList'] as $value) { | 98 | foreach ($baseInfo['promotionBoList'] as $value) { |
99 | - $build['title'] = $value['promotionTitle']; | ||
100 | - $build['type'] = $value['promotionType']; | 99 | + $build['text'] = $value['promotionTitle']; |
100 | + //$build['type'] = $value['promotionType']; | ||
101 | $result['goodsDiscount']['list'][] = $build; | 101 | $result['goodsDiscount']['list'][] = $build; |
102 | } | 102 | } |
103 | } | 103 | } |
@@ -146,6 +146,8 @@ class DetailModel | @@ -146,6 +146,8 @@ class DetailModel | ||
146 | 'storeName' => $baseInfo['brand']['brandName'], | 146 | 'storeName' => $baseInfo['brand']['brandName'], |
147 | 'url' => Helpers::url('', array(), $baseInfo['brand']['brandDomain']) | 147 | 'url' => Helpers::url('', array(), $baseInfo['brand']['brandDomain']) |
148 | ); | 148 | ); |
149 | + // 为你优选的链接 | ||
150 | + $result['preferenceUrl'] = Helpers::url('/product/detail/preference', array('productSkn' => $baseInfo['erpProductId'], 'brandId' => $baseInfo['brand']['id'])); | ||
149 | } | 151 | } |
150 | 152 | ||
151 | // 商品信息 | 153 | // 商品信息 |
@@ -448,12 +450,12 @@ class DetailModel | @@ -448,12 +450,12 @@ class DetailModel | ||
448 | * @param int $productSkn 商品SKN | 450 | * @param int $productSkn 商品SKN |
449 | * @return array | 451 | * @return array |
450 | */ | 452 | */ |
451 | - public static function getPreference($productSkn) | 453 | + public static function getPreference($productSkn, $channel, $brandId) |
452 | { | 454 | { |
453 | $result = array(); | 455 | $result = array(); |
454 | 456 | ||
455 | if (is_numeric($productSkn)) { | 457 | if (is_numeric($productSkn)) { |
456 | - $preference = DetailData::preference($productSkn); | 458 | + $preference = DetailData::preference($productSkn, $channel, $brandId); |
457 | if (!empty($preference['data'])) { | 459 | if (!empty($preference['data'])) { |
458 | foreach ($preference['data'] as $value) { | 460 | foreach ($preference['data'] as $value) { |
459 | $result['recommendList'][] = Helpers::formatProduct($value, false, true, true, 299, 388, false, false); | 461 | $result['recommendList'][] = Helpers::formatProduct($value, false, true, true, 299, 388, false, false); |
@@ -21,6 +21,7 @@ use Plugin\Cache; | @@ -21,6 +21,7 @@ use Plugin\Cache; | ||
21 | class NewsaleModel | 21 | class NewsaleModel |
22 | { | 22 | { |
23 | /* 男生频道取新品到着及折扣专区数据的位置码 */ | 23 | /* 男生频道取新品到着及折扣专区数据的位置码 */ |
24 | + | ||
24 | const CODE_TOP_NEW_BOYS = '3cf2c1be5217fbab6009ce83959e1e12'; | 25 | const CODE_TOP_NEW_BOYS = '3cf2c1be5217fbab6009ce83959e1e12'; |
25 | const CODE_TOP_SALE_BOYS = '153180b9a88c0b565848850c523bb637'; | 26 | const CODE_TOP_SALE_BOYS = '153180b9a88c0b565848850c523bb637'; |
26 | /* 女生频道取新品到着及折扣专区数据的位置码 */ | 27 | /* 女生频道取新品到着及折扣专区数据的位置码 */ |
@@ -125,7 +126,6 @@ class NewsaleModel | @@ -125,7 +126,6 @@ class NewsaleModel | ||
125 | return $result; | 126 | return $result; |
126 | } | 127 | } |
127 | 128 | ||
128 | - | ||
129 | /** | 129 | /** |
130 | * 获取折扣专区的商品列表 | 130 | * 获取折扣专区的商品列表 |
131 | * | 131 | * |
@@ -162,7 +162,6 @@ class NewsaleModel | @@ -162,7 +162,6 @@ class NewsaleModel | ||
162 | return $result; | 162 | return $result; |
163 | } | 163 | } |
164 | 164 | ||
165 | - | ||
166 | /** | 165 | /** |
167 | * 顶部焦点图缓存控制 | 166 | * 顶部焦点图缓存控制 |
168 | * @param const $cacheKey 缓存常量值 | 167 | * @param const $cacheKey 缓存常量值 |
@@ -184,7 +183,7 @@ class NewsaleModel | @@ -184,7 +183,7 @@ class NewsaleModel | ||
184 | $newsale = NewsaleData::getNewsaleFocus($codeKey); | 183 | $newsale = NewsaleData::getNewsaleFocus($codeKey); |
185 | 184 | ||
186 | // 调用接口获取数据并封装 | 185 | // 调用接口获取数据并封装 |
187 | - if (isset($newsale['code']) && isset($newsale['data']['list']) && !empty($newsale['data']['list'])) { | 186 | + if (isset($newsale['code']) && !empty($newsale['data']['list'])) { |
188 | if(count($newsale['data']['list'][0]['data']) === 1) { | 187 | if(count($newsale['data']['list'][0]['data']) === 1) { |
189 | $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240); | 188 | $result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240); |
190 | } else { | 189 | } else { |
@@ -217,41 +216,40 @@ class NewsaleModel | @@ -217,41 +216,40 @@ class NewsaleModel | ||
217 | public static function selectData($data) | 216 | public static function selectData($data) |
218 | { | 217 | { |
219 | $result = array(); | 218 | $result = array(); |
220 | - | 219 | + |
221 | if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { | 220 | if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { |
222 | foreach ($data['data']['product_list'] as $val) { | 221 | foreach ($data['data']['product_list'] as $val) { |
223 | - $result['goods'][] = Helpers::formatProduct($val, true, false, false, 299,388); | 222 | + $result['goods'][] = Helpers::formatProduct($val, true, false, false, 299, 388); |
224 | } | 223 | } |
225 | } | 224 | } |
226 | 225 | ||
227 | return $result; | 226 | return $result; |
228 | } | 227 | } |
229 | 228 | ||
230 | - /** | ||
231 | - * 筛选出来的热销排行榜商品数据处理 | ||
232 | - * | ||
233 | - * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 | ||
234 | - * @param string|null $sort 品类ID查询参数 | ||
235 | - * @param integer|null $tab_id Tab的ID | ||
236 | - * @param boolean $notab 时候返回顶部tab的数据,默认返回 | ||
237 | - * @param integer $limit 查询返回的最大限制数 | ||
238 | - * @param integer $page 分页第几页 | ||
239 | - * @return array 处理之后的数据 | ||
240 | - */ | 229 | + /** |
230 | + * 筛选出来的热销排行榜商品数据处理 | ||
231 | + * | ||
232 | + * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部 | ||
233 | + * @param string|null $sort 品类ID查询参数 | ||
234 | + * @param integer|null $tab_id Tab的ID | ||
235 | + * @param boolean $notab 时候返回顶部tab的数据,默认返回 | ||
236 | + * @param integer $limit 查询返回的最大限制数 | ||
237 | + * @param integer $page 分页第几页 | ||
238 | + * @return array 处理之后的数据 | ||
239 | + */ | ||
241 | public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page) | 240 | public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page) |
242 | { | 241 | { |
243 | $result = array(); | 242 | $result = array(); |
244 | 243 | ||
245 | - $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page); | 244 | + $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page); |
246 | 245 | ||
247 | if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { | 246 | if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { |
248 | - $result = NewSaleProcess::topData($data['data'], $notab, $limit, $page); | 247 | + $result = NewSaleProcess::topData($data['data'], $notab, $limit, $page); |
249 | } | 248 | } |
250 | 249 | ||
251 | return $result; | 250 | return $result; |
252 | } | 251 | } |
253 | 252 | ||
254 | - | ||
255 | /** | 253 | /** |
256 | * 获取筛选数据 | 254 | * 获取筛选数据 |
257 | * @param array $data 接口返回的数据 | 255 | * @param array $data 接口返回的数据 |
@@ -269,4 +267,5 @@ class NewsaleModel | @@ -269,4 +267,5 @@ class NewsaleModel | ||
269 | 267 | ||
270 | return $result; | 268 | return $result; |
271 | } | 269 | } |
270 | + | ||
272 | } | 271 | } |
@@ -19,6 +19,9 @@ class LoginController extends AbstractAction | @@ -19,6 +19,9 @@ class LoginController extends AbstractAction | ||
19 | { | 19 | { |
20 | $this->setTitle('登录'); | 20 | $this->setTitle('登录'); |
21 | 21 | ||
22 | + $refer = $this->get('refer', SITE_MAIN . '/?go=1'); | ||
23 | + $this->setCookie('refer', $refer); | ||
24 | + | ||
22 | $data = array( | 25 | $data = array( |
23 | 'loginIndex' => true, // 模板中使用JS的标识 | 26 | 'loginIndex' => true, // 模板中使用JS的标识 |
24 | 'backUrl' => '/', // 返回的URL链接 | 27 | 'backUrl' => '/', // 返回的URL链接 |
@@ -33,8 +36,6 @@ class LoginController extends AbstractAction | @@ -33,8 +36,6 @@ class LoginController extends AbstractAction | ||
33 | 'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接 | 36 | 'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接 |
34 | ); | 37 | ); |
35 | 38 | ||
36 | - // 生成HTML(signin.html) | ||
37 | - $this->_view->html('signin'); | ||
38 | // 渲染模板 | 39 | // 渲染模板 |
39 | $this->_view->display('index', $data); | 40 | $this->_view->display('index', $data); |
40 | } | 41 | } |
@@ -53,13 +54,11 @@ class LoginController extends AbstractAction | @@ -53,13 +54,11 @@ class LoginController extends AbstractAction | ||
53 | $data['isPassportPage'] = true; // 模板中模块标识 | 54 | $data['isPassportPage'] = true; // 模板中模块标识 |
54 | $data['areaCode'] = '+86'; // 默认区号 | 55 | $data['areaCode'] = '+86'; // 默认区号 |
55 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 | 56 | $data['countrys'] = RegData::getAreasData(); // 地区信息列表 |
56 | - // | ||
57 | - // 生成HTML(login.html) | ||
58 | - $this->_view->html('login'); | 57 | + |
59 | // 渲染模板 | 58 | // 渲染模板 |
60 | $this->_view->display('international', $data); | 59 | $this->_view->display('international', $data); |
61 | } | 60 | } |
62 | - | 61 | + |
63 | /** | 62 | /** |
64 | * 退出 | 63 | * 退出 |
65 | * | 64 | * |
@@ -68,7 +67,7 @@ class LoginController extends AbstractAction | @@ -68,7 +67,7 @@ class LoginController extends AbstractAction | ||
68 | public function outAction() | 67 | public function outAction() |
69 | { | 68 | { |
70 | $this->setCookie('_UID', ''); | 69 | $this->setCookie('_UID', ''); |
71 | - | 70 | + |
72 | headers_sent() || header('Location: /'); | 71 | headers_sent() || header('Location: /'); |
73 | } | 72 | } |
74 | 73 | ||
@@ -124,8 +123,7 @@ class LoginController extends AbstractAction | @@ -124,8 +123,7 @@ class LoginController extends AbstractAction | ||
124 | // $name = $profile['data']['mobile']; | 123 | // $name = $profile['data']['mobile']; |
125 | // } | 124 | // } |
126 | $data['data'] = '/'; // @todo | 125 | $data['data'] = '/'; // @todo |
127 | - } | ||
128 | - while (false); | 126 | + } while (false); |
129 | 127 | ||
130 | $this->echoJson($data); | 128 | $this->echoJson($data); |
131 | } | 129 | } |
@@ -188,8 +186,7 @@ class LoginController extends AbstractAction | @@ -188,8 +186,7 @@ class LoginController extends AbstractAction | ||
188 | $nickname = $userInfo['response']['user_info']['user_name']; | 186 | $nickname = $userInfo['response']['user_info']['user_name']; |
189 | // $alipayEmail = $userInfo['response']['user_info']['email']; | 187 | // $alipayEmail = $userInfo['response']['user_info']['email']; |
190 | } | 188 | } |
191 | - } | ||
192 | - else { | 189 | + } else { |
193 | $nickname = $_GET['real_name']; | 190 | $nickname = $_GET['real_name']; |
194 | // $alipayEmail = isset($_GET['email']) ? $_GET['email'] : ''; | 191 | // $alipayEmail = isset($_GET['email']) ? $_GET['email'] : ''; |
195 | } | 192 | } |
@@ -272,7 +272,7 @@ class RegController extends AbstractAction | @@ -272,7 +272,7 @@ class RegController extends AbstractAction | ||
272 | if (empty($refer)) { | 272 | if (empty($refer)) { |
273 | $refer = SITE_MAIN . '/?go=1'; | 273 | $refer = SITE_MAIN . '/?go=1'; |
274 | } | 274 | } |
275 | - $data['data'] = $refer; | 275 | + $data['data'] = rawurldecode($refer); |
276 | } | 276 | } |
277 | 277 | ||
278 | } while (false); | 278 | } while (false); |
@@ -182,7 +182,9 @@ class DetailController extends AbstractAction | @@ -182,7 +182,9 @@ class DetailController extends AbstractAction | ||
182 | 182 | ||
183 | if ($this->isAjax()) { | 183 | if ($this->isAjax()) { |
184 | $productSkn = $this->get('productSkn'); // 50000058 | 184 | $productSkn = $this->get('productSkn'); // 50000058 |
185 | - $result = \Product\DetailModel::getPreference($productSkn); | 185 | + $brandId = $this->get('brandId'); |
186 | + $channel = Helpers::getChannelByCookie(); | ||
187 | + $result = \Product\DetailModel::getPreference($productSkn, $channel, $brandId); | ||
186 | } | 188 | } |
187 | 189 | ||
188 | if (empty($result)) { | 190 | if (empty($result)) { |
@@ -79,11 +79,11 @@ class NewsaleController extends AbstractAction | @@ -79,11 +79,11 @@ class NewsaleController extends AbstractAction | ||
79 | $this->setTitle('热销排行榜'); | 79 | $this->setTitle('热销排行榜'); |
80 | $this->setNavHeader('热销排行榜'); | 80 | $this->setNavHeader('热销排行榜'); |
81 | 81 | ||
82 | - $channel = Helpers::getChannelByCookie(); | 82 | + $channel = Helpers::getChannelByCookie(); |
83 | // 设置一些默认参数 | 83 | // 设置一些默认参数 |
84 | $data = array( | 84 | $data = array( |
85 | 'hotrankPage' => true, | 85 | 'hotrankPage' => true, |
86 | - 'headerBanner' => \Product\NewsaleModel::getNewFocus($channel), | 86 | + 'headerBanner' => \Product\NewsaleModel::getNewFocus($channel), |
87 | 'showDownloadApp' => true, | 87 | 'showDownloadApp' => true, |
88 | 'pageFooter' => true, | 88 | 'pageFooter' => true, |
89 | 'cartUrl' => Helpers::url('/product/newsale/selectHotrank', null), | 89 | 'cartUrl' => Helpers::url('/product/newsale/selectHotrank', null), |
@@ -92,32 +92,32 @@ class NewsaleController extends AbstractAction | @@ -92,32 +92,32 @@ class NewsaleController extends AbstractAction | ||
92 | $this->_view->display('hotrank', $data); | 92 | $this->_view->display('hotrank', $data); |
93 | } | 93 | } |
94 | 94 | ||
95 | - /** | ||
96 | - * Ajax方式获取热销排行榜商品 | ||
97 | - * | ||
98 | - * @return array 根据指定条件筛选之后的商品 | ||
99 | - */ | ||
100 | - public function selectHotrankAction() | ||
101 | - { | ||
102 | - $result = array(); | ||
103 | - | ||
104 | - if ($this->isAjax()) { | ||
105 | - $sort = $this->get('sort', null); | ||
106 | - $tab_id = $this->get('tab_id', null); | ||
107 | - $limit = $this->get('limit', 50); | ||
108 | - $page = $this->get('page', 1); | ||
109 | - $notab = (boolean)$this->get('notab', false); | ||
110 | - | ||
111 | - // 获取性别 | ||
112 | - $gender = Helpers::getGenderByCookie(); | ||
113 | - $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page); | ||
114 | - } | ||
115 | - if (empty($result)) { | ||
116 | - echo ' '; | ||
117 | - } else { | ||
118 | - $this->_view->display('hotlist', $result); | ||
119 | - } | ||
120 | - } | 95 | + /** |
96 | + * Ajax方式获取热销排行榜商品 | ||
97 | + * | ||
98 | + * @return array 根据指定条件筛选之后的商品 | ||
99 | + */ | ||
100 | + public function selectHotrankAction() | ||
101 | + { | ||
102 | + $result = array(); | ||
103 | + | ||
104 | + if ($this->isAjax()) { | ||
105 | + $sort = $this->get('sort', null); | ||
106 | + $tab_id = $this->get('tab_id', null); | ||
107 | + $limit = $this->get('limit', 50); | ||
108 | + $page = $this->get('page', 1); | ||
109 | + $notab = (boolean) $this->get('notab', false); | ||
110 | + | ||
111 | + // 获取性别 | ||
112 | + $gender = Helpers::getGenderByCookie(); | ||
113 | + $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page); | ||
114 | + } | ||
115 | + if (empty($result)) { | ||
116 | + echo ' '; | ||
117 | + } else { | ||
118 | + $this->_view->display('hotlist', $result); | ||
119 | + } | ||
120 | + } | ||
121 | 121 | ||
122 | /** | 122 | /** |
123 | * Ajax方式筛选新品到着、折扣专区商品 | 123 | * Ajax方式筛选新品到着、折扣专区商品 |
@@ -127,7 +127,7 @@ class NewsaleController extends AbstractAction | @@ -127,7 +127,7 @@ class NewsaleController extends AbstractAction | ||
127 | public function selectNewSaleAction() | 127 | public function selectNewSaleAction() |
128 | { | 128 | { |
129 | $result = array(); | 129 | $result = array(); |
130 | - | 130 | + |
131 | if ($this->isAjax()) { | 131 | if ($this->isAjax()) { |
132 | $gender = $this->get('gender', null); | 132 | $gender = $this->get('gender', null); |
133 | $brand = $this->get('brand', null); | 133 | $brand = $this->get('brand', null); |
@@ -149,7 +149,7 @@ class NewsaleController extends AbstractAction | @@ -149,7 +149,7 @@ class NewsaleController extends AbstractAction | ||
149 | $channel = Helpers::getChannelByCookie(); | 149 | $channel = Helpers::getChannelByCookie(); |
150 | 150 | ||
151 | $data = NewsaleData::selectNewSaleProducts( | 151 | $data = NewsaleData::selectNewSaleProducts( |
152 | - $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order | 152 | + $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order |
153 | ); | 153 | ); |
154 | $result = \Product\NewsaleModel::selectData($data); | 154 | $result = \Product\NewsaleModel::selectData($data); |
155 | } | 155 | } |
-
Please register or login to post a comment