Merge branch 'hotfix/payLaftTime' into develop
Showing
51 changed files
with
311 additions
and
182 deletions
compile/www.yohobuy.com/0.0.26/test.php
0 → 100644
@@ -20,6 +20,7 @@ use Hood\Session; | @@ -20,6 +20,7 @@ use Hood\Session; | ||
20 | use WebPlugin\Mobile; | 20 | use WebPlugin\Mobile; |
21 | use Api\Yohobuy; | 21 | use Api\Yohobuy; |
22 | use LibModels\Web\Passport\LoginData; | 22 | use LibModels\Web\Passport\LoginData; |
23 | +use WebPlugin\UdpLog; | ||
23 | 24 | ||
24 | class WebAction extends Controller_Abstract | 25 | class WebAction extends Controller_Abstract |
25 | { | 26 | { |
@@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract | @@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract | ||
383 | $token = Helpers::makeToken($uid); | 384 | $token = Helpers::makeToken($uid); |
384 | $uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token; | 385 | $uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token; |
385 | $this->setCookie('_UID',$uidCookie,time() + 86400 * 360); | 386 | $this->setCookie('_UID',$uidCookie,time() + 86400 * 360); |
387 | + UdpLog::info('【登录】同步登陆cookie生成',$uidCookie); | ||
386 | } | 388 | } |
387 | $this->setSession('_TOKEN', $token); | 389 | $this->setSession('_TOKEN', $token); |
388 | $this->setSession('_LOGIN_UID', $uid); | 390 | $this->setSession('_LOGIN_UID', $uid); |
@@ -402,7 +404,7 @@ class WebAction extends Controller_Abstract | @@ -402,7 +404,7 @@ class WebAction extends Controller_Abstract | ||
402 | if (!$this->_useSession) { | 404 | if (!$this->_useSession) { |
403 | $useSession = false; | 405 | $useSession = false; |
404 | } | 406 | } |
405 | - $useSession = false; | 407 | + //$useSession = false; |
406 | 408 | ||
407 | if (!$this->_uid) { | 409 | if (!$this->_uid) { |
408 | $cookie = $this->getCookie('_UID'); | 410 | $cookie = $this->getCookie('_UID'); |
@@ -22,20 +22,21 @@ class Yohobuy | @@ -22,20 +22,21 @@ class Yohobuy | ||
22 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 22 | // const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
23 | 23 | ||
24 | //java API | 24 | //java API |
25 | - // const API_URL = 'http://api.yoho.yohoops.org/';// | ||
26 | - // const API_URL2 = 'http://api.yoho.yohoops.org/';// | ||
27 | - // const SERVICE_URL = 'http://service.yoho.yohoops.org/'; | ||
28 | - // const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
29 | - // const API_OLD = 'http://api2.open.yohobuy.com/'; | ||
30 | - // const SERVICE_NOTIFY = 'http://service.yoho.cn/';// 支付回调地址 | ||
31 | - | ||
32 | - // 测试环境 | ||
33 | - const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/' | ||
34 | - const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; | 25 | + const API_URL = 'http://api.yoho.yohoops.org/';// |
26 | + const API_URL2 = 'http://api.yoho.yohoops.org/';// | ||
27 | + const SERVICE_URL = 'http://service.yoho.yohoops.org/'; | ||
35 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; | 28 | const YOHOBUY_URL = 'http://www.yohobuy.com/'; |
36 | - const API_OLD = 'http://test2.open.yohobuy.com/'; | ||
37 | - // 支付回调地址 | ||
38 | - const SERVICE_NOTIFY = 'http://testservice.yoho.cn:28077/'; | 29 | + const API_OLD = 'http://api2.open.yohobuy.com/'; |
30 | +//// 支付回调地址 | ||
31 | + const SERVICE_NOTIFY = 'http://service.yoho.cn/'; | ||
32 | + | ||
33 | + // 测试环境 */ | ||
34 | +// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/' | ||
35 | +// const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; | ||
36 | +// const YOHOBUY_URL = 'http://www.yohobuy.com/'; | ||
37 | +// const API_OLD = 'http://test2.open.yohobuy.com/'; | ||
38 | +//// 支付回调地址 | ||
39 | +// const SERVICE_NOTIFY = 'http://testservice.yoho.cn:28077/'; | ||
39 | 40 | ||
40 | /* 预览环境 */ | 41 | /* 预览环境 */ |
41 | // const API_URL = 'http://preapi.yoho.cn/'; | 42 | // const API_URL = 'http://preapi.yoho.cn/'; |
@@ -95,7 +95,7 @@ class InfoData | @@ -95,7 +95,7 @@ class InfoData | ||
95 | */ | 95 | */ |
96 | public static function getArticleInfo($id, $onlyUrl = false) | 96 | public static function getArticleInfo($id, $onlyUrl = false) |
97 | { | 97 | { |
98 | - $param['article_id'] = $id; | 98 | + $param['article_id'] = intval($id); |
99 | return self::webApi(self::getUrl('getArticle'), $param, $onlyUrl); | 99 | return self::webApi(self::getUrl('getArticle'), $param, $onlyUrl); |
100 | } | 100 | } |
101 | 101 | ||
@@ -107,7 +107,7 @@ class InfoData | @@ -107,7 +107,7 @@ class InfoData | ||
107 | */ | 107 | */ |
108 | public static function author($authorId, $onlyUrl = false) | 108 | public static function author($authorId, $onlyUrl = false) |
109 | { | 109 | { |
110 | - $param['author_id'] = $authorId; | 110 | + $param['author_id'] = intval($authorId); |
111 | return self::webApi(self::getUrl('author'), $param, $onlyUrl); | 111 | return self::webApi(self::getUrl('author'), $param, $onlyUrl); |
112 | } | 112 | } |
113 | 113 | ||
@@ -121,8 +121,8 @@ class InfoData | @@ -121,8 +121,8 @@ class InfoData | ||
121 | 121 | ||
122 | public static function tagTop($page = 1,$limit = 10, $onlyUrl = false) | 122 | public static function tagTop($page = 1,$limit = 10, $onlyUrl = false) |
123 | { | 123 | { |
124 | - $param['page'] = $page; | ||
125 | - $param['limit'] = $limit; | 124 | + $param['page'] = intval($page); |
125 | + $param['limit'] = intval($limit); | ||
126 | return self::webApi(self::getUrl('getTagTop'), $param, $onlyUrl); | 126 | return self::webApi(self::getUrl('getTagTop'), $param, $onlyUrl); |
127 | } | 127 | } |
128 | 128 | ||
@@ -136,9 +136,9 @@ class InfoData | @@ -136,9 +136,9 @@ class InfoData | ||
136 | */ | 136 | */ |
137 | public static function comment($articleId, $page = 1, $limit = 10, $onlyUrl = false) | 137 | public static function comment($articleId, $page = 1, $limit = 10, $onlyUrl = false) |
138 | { | 138 | { |
139 | - $param['article_id'] = $articleId; | ||
140 | - $param['page'] = $page; | ||
141 | - $param['limit'] = $limit; | 139 | + $param['article_id'] = intval($articleId); |
140 | + $param['page'] = intval($page); | ||
141 | + $param['limit'] = intval($limit); | ||
142 | return self::webApi(self::getUrl('commentList'), $param, $onlyUrl); | 142 | return self::webApi(self::getUrl('commentList'), $param, $onlyUrl); |
143 | } | 143 | } |
144 | 144 | ||
@@ -150,7 +150,7 @@ class InfoData | @@ -150,7 +150,7 @@ class InfoData | ||
150 | */ | 150 | */ |
151 | public static function articleContent($articleId, $onlyUrl = false) | 151 | public static function articleContent($articleId, $onlyUrl = false) |
152 | { | 152 | { |
153 | - $param['article_id'] = $articleId; | 153 | + $param['article_id'] = intval($articleId); |
154 | return self::webApi(self::getUrl('getArticleContent'), $param, $onlyUrl); | 154 | return self::webApi(self::getUrl('getArticleContent'), $param, $onlyUrl); |
155 | } | 155 | } |
156 | 156 | ||
@@ -164,7 +164,7 @@ class InfoData | @@ -164,7 +164,7 @@ class InfoData | ||
164 | */ | 164 | */ |
165 | public static function baseInfo($articleId, $uid, $udid, $onlyUrl = false) | 165 | public static function baseInfo($articleId, $uid, $udid, $onlyUrl = false) |
166 | { | 166 | { |
167 | - $param['id'] = $articleId; | 167 | + $param['id'] = intval($articleId); |
168 | $param['uid'] = $uid; | 168 | $param['uid'] = $uid; |
169 | $param['udid'] = $udid; | 169 | $param['udid'] = $udid; |
170 | return self::webApi(self::getUrl('getArticleBaseInfo'), $param, $onlyUrl); | 170 | return self::webApi(self::getUrl('getArticleBaseInfo'), $param, $onlyUrl); |
@@ -178,7 +178,7 @@ class InfoData | @@ -178,7 +178,7 @@ class InfoData | ||
178 | */ | 178 | */ |
179 | public static function relateBrand($articleId, $onlyUrl = false) | 179 | public static function relateBrand($articleId, $onlyUrl = false) |
180 | { | 180 | { |
181 | - $param['article_id'] = $articleId; | 181 | + $param['article_id'] = intval($articleId); |
182 | return self::webApi(self::getUrl('getBrand'), $param, $onlyUrl); | 182 | return self::webApi(self::getUrl('getBrand'), $param, $onlyUrl); |
183 | } | 183 | } |
184 | 184 | ||
@@ -192,9 +192,9 @@ class InfoData | @@ -192,9 +192,9 @@ class InfoData | ||
192 | */ | 192 | */ |
193 | public static function relateList($articleId, $tag, $limit = 3, $onlyUrl = false) | 193 | public static function relateList($articleId, $tag, $limit = 3, $onlyUrl = false) |
194 | { | 194 | { |
195 | - $param['article_id'] = $articleId; | 195 | + $param['article_id'] = intval($articleId); |
196 | $param['tags'] = $tag; | 196 | $param['tags'] = $tag; |
197 | - $param['limit'] = $limit; | 197 | + $param['limit'] = intval($limit); |
198 | return self::webApi(self::getUrl('getOtherArticle'), $param, $onlyUrl); | 198 | return self::webApi(self::getUrl('getOtherArticle'), $param, $onlyUrl); |
199 | } | 199 | } |
200 | 200 | ||
@@ -210,8 +210,8 @@ class InfoData | @@ -210,8 +210,8 @@ class InfoData | ||
210 | public static function recommend($gender, $page = 1, $limit = 10, $onlyUrl = false) | 210 | public static function recommend($gender, $page = 1, $limit = 10, $onlyUrl = false) |
211 | { | 211 | { |
212 | $param['gender'] = $gender; | 212 | $param['gender'] = $gender; |
213 | - $param['page'] = $page; | ||
214 | - $param['limit'] = $limit; | 213 | + $param['page'] = intval($page); |
214 | + $param['limit'] = intval($limit); | ||
215 | return self::webApi(self::getUrl('getArticleByViewsNum'), $param, $onlyUrl); | 215 | return self::webApi(self::getUrl('getArticleByViewsNum'), $param, $onlyUrl); |
216 | } | 216 | } |
217 | 217 | ||
@@ -224,7 +224,7 @@ class InfoData | @@ -224,7 +224,7 @@ class InfoData | ||
224 | */ | 224 | */ |
225 | public static function addComment($id, $uid, $content) | 225 | public static function addComment($id, $uid, $content) |
226 | { | 226 | { |
227 | - $param['article_id'] = $id; | 227 | + $param['article_id'] = intval($id); |
228 | $param['uid'] = $uid; | 228 | $param['uid'] = $uid; |
229 | $param['content'] = $content; | 229 | $param['content'] = $content; |
230 | return self::webApi(self::getUrl('addComment'), $param); | 230 | return self::webApi(self::getUrl('addComment'), $param); |
@@ -238,7 +238,7 @@ class InfoData | @@ -238,7 +238,7 @@ class InfoData | ||
238 | */ | 238 | */ |
239 | public static function setPraise($id, $udid) | 239 | public static function setPraise($id, $udid) |
240 | { | 240 | { |
241 | - $param['article_id'] = $id; | 241 | + $param['article_id'] = intval($id); |
242 | $param['udid'] = $udid; | 242 | $param['udid'] = $udid; |
243 | return self::webApi(self::getUrl('setPraise'), $param); | 243 | return self::webApi(self::getUrl('setPraise'), $param); |
244 | } | 244 | } |
@@ -251,7 +251,7 @@ class InfoData | @@ -251,7 +251,7 @@ class InfoData | ||
251 | */ | 251 | */ |
252 | public static function cancelPraise($id, $udid) | 252 | public static function cancelPraise($id, $udid) |
253 | { | 253 | { |
254 | - $param['article_id'] = $id; | 254 | + $param['article_id'] = intval($id); |
255 | $param['udid'] = $udid; | 255 | $param['udid'] = $udid; |
256 | return self::webApi(self::getUrl('cancelPraise'), $param); | 256 | return self::webApi(self::getUrl('cancelPraise'), $param); |
257 | } | 257 | } |
@@ -264,7 +264,7 @@ class InfoData | @@ -264,7 +264,7 @@ class InfoData | ||
264 | */ | 264 | */ |
265 | public static function setFavorite($id, $uid) | 265 | public static function setFavorite($id, $uid) |
266 | { | 266 | { |
267 | - $param['article_id'] = $id; | 267 | + $param['article_id'] = intval($id); |
268 | $param['uid'] = $uid; | 268 | $param['uid'] = $uid; |
269 | return self::webApi(self::getUrl('setFavorite'), $param); | 269 | return self::webApi(self::getUrl('setFavorite'), $param); |
270 | } | 270 | } |
@@ -277,7 +277,7 @@ class InfoData | @@ -277,7 +277,7 @@ class InfoData | ||
277 | */ | 277 | */ |
278 | public static function cancelFavorite($id, $uid) | 278 | public static function cancelFavorite($id, $uid) |
279 | { | 279 | { |
280 | - $param['article_id'] = $id; | 280 | + $param['article_id'] = intval($id); |
281 | $param['uid'] = $uid; | 281 | $param['uid'] = $uid; |
282 | return self::webApi(self::getUrl('cancelFavorite'), $param); | 282 | return self::webApi(self::getUrl('cancelFavorite'), $param); |
283 | } | 283 | } |
@@ -522,5 +522,5 @@ class CartData | @@ -522,5 +522,5 @@ class CartData | ||
522 | $param['payment'] = $payment; | 522 | $param['payment'] = $payment; |
523 | $param['client_secret'] = Sign::getSign($param); | 523 | $param['client_secret'] = Sign::getSign($param); |
524 | return Yohobuy::get(Yohobuy::API_URL, $param); | 524 | return Yohobuy::get(Yohobuy::API_URL, $param); |
525 | - } | 525 | + } |
526 | } | 526 | } |
@@ -25,6 +25,7 @@ class PayData | @@ -25,6 +25,7 @@ class PayData | ||
25 | { | 25 | { |
26 | $param = Yohobuy::param(); | 26 | $param = Yohobuy::param(); |
27 | $param['client_type'] = 'web'; | 27 | $param['client_type'] = 'web'; |
28 | + $param['uid'] = intval($uid); | ||
28 | $param['private_key'] = Yohobuy::$privateKeyList['web']; | 29 | $param['private_key'] = Yohobuy::$privateKeyList['web']; |
29 | $param['method'] = 'web.SpaceOrders.getOrderCountByUid'; | 30 | $param['method'] = 'web.SpaceOrders.getOrderCountByUid'; |
30 | 31 |
@@ -15,13 +15,13 @@ use Api\Sign; | @@ -15,13 +15,13 @@ use Api\Sign; | ||
15 | class SaleData | 15 | class SaleData |
16 | { | 16 | { |
17 | /** | 17 | /** |
18 | - * @param $specialsaleId 专区ID | 18 | + * @param int $specialsaleId 专区ID |
19 | * @return array | 19 | * @return array |
20 | */ | 20 | */ |
21 | public static function getSpecial($specialsaleId) | 21 | public static function getSpecial($specialsaleId) |
22 | { | 22 | { |
23 | $param = Yohobuy::param(); | 23 | $param = Yohobuy::param(); |
24 | - $param['special_id'] = $specialsaleId; | 24 | + $param['special_id'] = intval($specialsaleId); |
25 | $param['method'] = 'app.resources.getOneSpecial'; | 25 | $param['method'] = 'app.resources.getOneSpecial'; |
26 | $param['client_secret'] = Sign::getSign($param); | 26 | $param['client_secret'] = Sign::getSign($param); |
27 | 27 |
@@ -42,8 +42,6 @@ class Service extends PayAbstract | @@ -42,8 +42,6 @@ class Service extends PayAbstract | ||
42 | public function getPayRequestPars(Reqparams $params) | 42 | public function getPayRequestPars(Reqparams $params) |
43 | { | 43 | { |
44 | // $baseUrl = $this->getBaseNoticeUrl($params->isTest); | 44 | // $baseUrl = $this->getBaseNoticeUrl($params->isTest); |
45 | -// $loseTime = intval(($params->orderTime + 7200 - time()) / 60); | ||
46 | - // $loseTime = intval((strtotime(date("Y-m-d 10:00:00", strtotime("+1 day")))-time())/60); | ||
47 | UdpLog::info("【{$this->logProjectPrefix}-支付宝银行支付】,function:getPayRequestPars,参数", $params); | 45 | UdpLog::info("【{$this->logProjectPrefix}-支付宝银行支付】,function:getPayRequestPars,参数", $params); |
48 | $parameter = array( | 46 | $parameter = array( |
49 | 'service' => $this->config->service, | 47 | 'service' => $this->config->service, |
@@ -58,7 +56,7 @@ class Service extends PayAbstract | @@ -58,7 +56,7 @@ class Service extends PayAbstract | ||
58 | 'payment_type' => $this->config->payment_type, | 56 | 'payment_type' => $this->config->payment_type, |
59 | 'defaultbank' => $params->paymentParameter, | 57 | 'defaultbank' => $params->paymentParameter, |
60 | 'seller_email' => $this->config->sellerMail, | 58 | 'seller_email' => $this->config->sellerMail, |
61 | -// 'it_b_pay' => $loseTime . 'm' | 59 | + 'it_b_pay' => $params->payExpireMinute . 'm', |
62 | ); | 60 | ); |
63 | if ($this->config->anti_fishing['timestamp_enable']) { | 61 | if ($this->config->anti_fishing['timestamp_enable']) { |
64 | $anti_phishing_key = $this->getTimestamp(); | 62 | $anti_phishing_key = $this->getTimestamp(); |
@@ -47,8 +47,6 @@ class Service extends PayAbstract | @@ -47,8 +47,6 @@ class Service extends PayAbstract | ||
47 | { | 47 | { |
48 | UdpLog::info("【{$this->logProjectPrefix}-支付宝支付】,function:getPayRequestPars,参数", $params); | 48 | UdpLog::info("【{$this->logProjectPrefix}-支付宝支付】,function:getPayRequestPars,参数", $params); |
49 | // $baseUrl = $this->getBaseNoticeUrl($params->isTest); | 49 | // $baseUrl = $this->getBaseNoticeUrl($params->isTest); |
50 | -// $loseTime = intval(($params->orderTime + 7200 -time())/60); | ||
51 | -// $loseTime = intval((strtotime(date("Y-m-d 10:00:00", strtotime("+1 day")))-time())/60); //第二天十点 | ||
52 | $parameter = array( | 50 | $parameter = array( |
53 | 'service' => $this->config->service, | 51 | 'service' => $this->config->service, |
54 | 'partner' => $this->config->partner, | 52 | 'partner' => $this->config->partner, |
@@ -58,13 +56,14 @@ class Service extends PayAbstract | @@ -58,13 +56,14 @@ class Service extends PayAbstract | ||
58 | /* 业务参数 */ | 56 | /* 业务参数 */ |
59 | 'subject' => $params->goodsName, | 57 | 'subject' => $params->goodsName, |
60 | 'out_trade_no' => $params->orderCode, | 58 | 'out_trade_no' => $params->orderCode, |
61 | -// 'it_b_pay' => $loseTime . 'm', | 59 | + 'it_b_pay' => $params->payExpireMinute . 'm', |
62 | 'total_fee' => $params->totalFee / 100, //单位为元 | 60 | 'total_fee' => $params->totalFee / 100, //单位为元 |
63 | 'payment_type' => $this->config->payment_type, | 61 | 'payment_type' => $this->config->payment_type, |
64 | 'seller_email' => $this->config->sellerMail, | 62 | 'seller_email' => $this->config->sellerMail, |
65 | 'sign_id_ext' => $params->uid, | 63 | 'sign_id_ext' => $params->uid, |
66 | 'sign_name_ext' => $params->userName | 64 | 'sign_name_ext' => $params->userName |
67 | ); | 65 | ); |
66 | + | ||
68 | if ($this->config->anti_fishing['timestamp_enable']) { | 67 | if ($this->config->anti_fishing['timestamp_enable']) { |
69 | $anti_phishing_key = $this->getTimestamp(); | 68 | $anti_phishing_key = $this->getTimestamp(); |
70 | if (!empty($anti_phishing_key)) { | 69 | if (!empty($anti_phishing_key)) { |
@@ -11,17 +11,25 @@ namespace WebPlugin\Pay; | @@ -11,17 +11,25 @@ namespace WebPlugin\Pay; | ||
11 | class Reqparams | 11 | class Reqparams |
12 | { | 12 | { |
13 | 13 | ||
14 | - public function __construct($_orderCode, $_totalFee, $_goodName, $client_ip, $_orderTime, $_paymentParameter="", $_isTest=false, $uid=0, $userName='') | 14 | + public function __construct($_orderCode, $_totalFee, $_goodName, $client_ip, $_orderTime, $_paymentParameter="", $_isTest=false, $uid=0, $userName='', $_payExpire = '') |
15 | { | 15 | { |
16 | - $this->orderCode = $_orderCode; | ||
17 | - $this->totalFee = $_totalFee; | ||
18 | - $this->goodsName = $_goodName; | ||
19 | - $this->spbill_create_ip = $client_ip; | ||
20 | - $this->orderTime = $_orderTime; | ||
21 | - $this->paymentParameter = $_paymentParameter; | ||
22 | - $this->isTest = $_isTest; | ||
23 | - $this->uid = $uid; | ||
24 | - $this->userName = $userName; | 16 | + //到期时间,默认为当前时间加2个小时的时间戳 |
17 | + $_payExpire = empty($_payExpire) ? strtotime('+2 hours') : strtotime($_payExpire); | ||
18 | + $payExpireMinute = 0;//剩余分钟数 | ||
19 | + if ($_payExpire && ($expireTime = $_payExpire - time()) > 0) { | ||
20 | + $payExpireMinute = floor($expireTime / 60); | ||
21 | + } | ||
22 | + | ||
23 | + $this->orderCode = $_orderCode; | ||
24 | + $this->totalFee = $_totalFee; | ||
25 | + $this->goodsName = $_goodName; | ||
26 | + $this->spbill_create_ip = $client_ip; | ||
27 | + $this->orderTime = $_orderTime; | ||
28 | + $this->payExpireMinute = $payExpireMinute; | ||
29 | + $this->paymentParameter = $_paymentParameter; | ||
30 | + $this->isTest = $_isTest; | ||
31 | + $this->uid = $uid; | ||
32 | + $this->userName = $userName; | ||
25 | } | 33 | } |
26 | 34 | ||
27 | /** | 35 | /** |
@@ -162,7 +162,7 @@ class TemplateLayout implements View_Interface | @@ -162,7 +162,7 @@ class TemplateLayout implements View_Interface | ||
162 | $template = file_get_contents($viewName, false, null); | 162 | $template = file_get_contents($viewName, false, null); |
163 | $phpStr = LightnCandy::compile($template, array( | 163 | $phpStr = LightnCandy::compile($template, array( |
164 | // DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION | 164 | // DEBUG: LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION |
165 | - 'flags' => LightnCandy::FLAG_RENDER_DEBUG | LightnCandy::FLAG_ERROR_EXCEPTION | LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式 | 165 | + 'flags' => LightnCandy::FLAG_MUSTACHE | LightnCandy::FLAG_HANDLEBARS, // 使用MUSTACHE和HANDLEBARS的模板格式 |
166 | 'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录 | 166 | 'basedir' => array($config->template->partials), // 模板里使用 {{> partial_name}} 时查找的目录 |
167 | 'fileext' => array($tplExt), // 允许查找文件的后缀 | 167 | 'fileext' => array($tplExt), // 允许查找文件的后缀 |
168 | 'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime | 168 | 'lcrun' => 'Plugin\LCRun3', // 指定编译模板的runtime |
library/WebPlugin/TriggerError.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace WebPlugin; | ||
4 | + | ||
5 | +use WebPlugin\UdpLog; | ||
6 | +/** | ||
7 | + * 异常错误日志 | ||
8 | + */ | ||
9 | +class TriggerError | ||
10 | +{ | ||
11 | + public static function myErrorHandler($errno, $errstr, $errfile, $errline) | ||
12 | + { | ||
13 | +// print_r(get_defined_constants());exit; | ||
14 | + switch ($errno) { | ||
15 | + case \YAF\ERR\NOTFOUND\CONTROLLER: | ||
16 | + case \YAF\ERR\NOTFOUND\MODULE: | ||
17 | + case \YAF\ERR\NOTFOUND\ACTION: | ||
18 | + header("Not Found"); | ||
19 | + break; | ||
20 | + default: | ||
21 | + $data['errno'] = $errno; | ||
22 | + $data['errstr'] = $errstr; | ||
23 | + $data['errfile'] = $errfile; | ||
24 | + $data['errline'] = $errline; | ||
25 | + UdpLog::triggerError('triggerError',$data); | ||
26 | + break; | ||
27 | + } | ||
28 | + return true; | ||
29 | + } | ||
30 | +} |
@@ -17,6 +17,8 @@ namespace WebPlugin; | @@ -17,6 +17,8 @@ namespace WebPlugin; | ||
17 | */ | 17 | */ |
18 | class UdpLog | 18 | class UdpLog |
19 | { | 19 | { |
20 | + //日志开关 | ||
21 | + private static $flag = true; | ||
20 | //influxdb url | 22 | //influxdb url |
21 | public static $url = 'influxdb.yohobuy.com'; | 23 | public static $url = 'influxdb.yohobuy.com'; |
22 | //influxdb port | 24 | //influxdb port |
@@ -32,6 +34,15 @@ class UdpLog | @@ -32,6 +34,15 @@ class UdpLog | ||
32 | const RECORD_MODE = 'FILE';//mode: FILE | UDP | 34 | const RECORD_MODE = 'FILE';//mode: FILE | UDP |
33 | 35 | ||
34 | /** | 36 | /** |
37 | + * 初始化 | ||
38 | + */ | ||
39 | + private function __construct() | ||
40 | + { | ||
41 | + if (self::$flag) { | ||
42 | + return; | ||
43 | + } | ||
44 | + } | ||
45 | + /** | ||
35 | * proc line and send log to influxdb | 46 | * proc line and send log to influxdb |
36 | * @param $level | 47 | * @param $level |
37 | * @param $message | 48 | * @param $message |
@@ -158,4 +169,13 @@ class UdpLog | @@ -158,4 +169,13 @@ class UdpLog | ||
158 | public static function debug($message, $meta = '') { | 169 | public static function debug($message, $meta = '') { |
159 | self::procLog(__METHOD__, $message, debug_backtrace(), $meta); | 170 | self::procLog(__METHOD__, $message, debug_backtrace(), $meta); |
160 | } | 171 | } |
172 | + | ||
173 | + /** | ||
174 | + * yaf trigger error | ||
175 | + * @param $message | ||
176 | + * @param mixed $meta | ||
177 | + */ | ||
178 | + public static function triggerError($message, $meta = '') { | ||
179 | + self::procLog(__METHOD__, $message, debug_backtrace(), $meta); | ||
180 | + } | ||
161 | } | 181 | } |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
web-static/dist/yohobuy/0.0.26/index.css
0 → 100644
This diff could not be displayed because it is too large.
web-static/dist/yohobuy/0.0.26/index.js
0 → 100644
This diff could not be displayed because it is too large.
web-static/dist/yohobuy/0.0.26/lib.js
0 → 100644
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
web-static/dist/yohobuy/0.0.27/index.css
0 → 100644
This diff could not be displayed because it is too large.
web-static/dist/yohobuy/0.0.27/index.js
0 → 100644
This diff could not be displayed because it is too large.
@@ -191,6 +191,7 @@ | @@ -191,6 +191,7 @@ | ||
191 | text-align: center; | 191 | text-align: center; |
192 | line-height: 1.5; | 192 | line-height: 1.5; |
193 | background: #f5f5f5; | 193 | background: #f5f5f5; |
194 | + font-weight: bold; | ||
194 | 195 | ||
195 | img { | 196 | img { |
196 | width: 235px; | 197 | width: 235px; |
@@ -431,7 +432,7 @@ | @@ -431,7 +432,7 @@ | ||
431 | } | 432 | } |
432 | } | 433 | } |
433 | } | 434 | } |
434 | - | 435 | + |
435 | .goods-wrap { | 436 | .goods-wrap { |
436 | .goods-container { | 437 | .goods-container { |
437 | .good-info { | 438 | .good-info { |
@@ -499,6 +500,7 @@ | @@ -499,6 +500,7 @@ | ||
499 | display: inline-block; | 500 | display: inline-block; |
500 | line-height: 14px; | 501 | line-height: 14px; |
501 | vertical-align: middle; | 502 | vertical-align: middle; |
503 | + font-weight: bold; | ||
502 | 504 | ||
503 | .name { | 505 | .name { |
504 | font-size: 14px; | 506 | font-size: 14px; |
@@ -58,7 +58,7 @@ class SearchModel | @@ -58,7 +58,7 @@ class SearchModel | ||
58 | } | 58 | } |
59 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | 59 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 |
60 | else { | 60 | else { |
61 | - Cache::set($key, $result, 600); // 缓存10分钟 | 61 | + Cache::set($key, $result, 300); // 缓存5分钟 |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
@@ -116,7 +116,7 @@ class SearchModel | @@ -116,7 +116,7 @@ class SearchModel | ||
116 | } | 116 | } |
117 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | 117 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 |
118 | else { | 118 | else { |
119 | - Cache::set($key, $result, 600); // 缓存10分钟 | 119 | + Cache::set($key, $result, 300); // 缓存5分钟 |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 |
@@ -149,6 +149,15 @@ class Bootstrap extends Bootstrap_Abstract | @@ -149,6 +149,15 @@ class Bootstrap extends Bootstrap_Abstract | ||
149 | //} | 149 | //} |
150 | } | 150 | } |
151 | 151 | ||
152 | + /** | ||
153 | + * triggerError | ||
154 | + * @param Dispatcher $dispatcher | ||
155 | + */ | ||
156 | + public function _initError(Dispatcher $dispatcher) | ||
157 | + { | ||
158 | + $dispatcher->getInstance()->setErrorHandler(array("\\WebPlugin\\TriggerError","myErrorHandler")); | ||
159 | + } | ||
160 | + | ||
152 | // /** | 161 | // /** |
153 | // * 初始化第三方包 | 162 | // * 初始化第三方包 |
154 | // * @param Dispatcher $dispatcher | 163 | // * @param Dispatcher $dispatcher |
@@ -45,7 +45,7 @@ class CouponModel | @@ -45,7 +45,7 @@ class CouponModel | ||
45 | foreach ($couponlistval['data'] as $focus) { | 45 | foreach ($couponlistval['data'] as $focus) { |
46 | $result['slide']['list'][] = array( | 46 | $result['slide']['list'][] = array( |
47 | 'href' => $focus['url'], //banner跳转链接 | 47 | 'href' => $focus['url'], //banner跳转链接 |
48 | - 'img' => Images::getImageUrl($focus['src'], 0, 0)//banner图片 | 48 | + 'img' => Images::getForceSourceUrl($focus['src'])//banner图片 |
49 | ); | 49 | ); |
50 | } | 50 | } |
51 | } | 51 | } |
@@ -61,7 +61,7 @@ class CouponModel | @@ -61,7 +61,7 @@ class CouponModel | ||
61 | foreach ($couponlistval['data'] as $couponskey => $couponsval) { | 61 | foreach ($couponlistval['data'] as $couponskey => $couponsval) { |
62 | $result['categories'][$i]['coupons'][$couponskey] = array( | 62 | $result['categories'][$i]['coupons'][$couponskey] = array( |
63 | 'id' => $couponsval['couponID'], //优惠券号 | 63 | 'id' => $couponsval['couponID'], //优惠券号 |
64 | - 'img' => Images::getImageUrl($couponsval['image']['src'], 0, 0), //优惠券图片 | 64 | + 'img' => Images::getForceSourceUrl($couponsval['image']['src']), //优惠券图片 |
65 | 'url' => $couponsval['image']['url'] //去逛逛链接 | 65 | 'url' => $couponsval['image']['url'] //去逛逛链接 |
66 | ); | 66 | ); |
67 | 67 |
@@ -199,13 +199,19 @@ class ItemModel | @@ -199,13 +199,19 @@ class ItemModel | ||
199 | 199 | ||
200 | if (!empty($banner['brandId'])) { | 200 | if (!empty($banner['brandId'])) { |
201 | $domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']); | 201 | $domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']); |
202 | - if (empty($domainBrand['type']) || $domainBrand['type'] !== 2) { | ||
203 | - //多品店不显示 | ||
204 | - $banner = array(); | ||
205 | - } else { | ||
206 | - $basisData = ShopModel::basisTemplate($domainBrand['shopId']); | ||
207 | - $banner['bgImg'] = empty($basisData['shopTopBanner']['banner']) ? | ||
208 | - $banner['bgImg'] : $basisData['shopTopBanner']['banner']; | 202 | + if (!empty($domainBrand['type']) && !empty($domainBrand['shopId'])) { |
203 | + switch (intval($domainBrand['type'])) { | ||
204 | + case 1: | ||
205 | + //多品店不显示 | ||
206 | + $banner = array(); | ||
207 | + break; | ||
208 | + case 2: | ||
209 | + //单品店显示新版的店铺banner | ||
210 | + $basisData = ShopModel::basisTemplate($domainBrand['shopId']); | ||
211 | + $banner['bgImg'] = empty($basisData['shopTopBanner']['banner']) ? | ||
212 | + $banner['bgImg'] : $basisData['shopTopBanner']['banner']; | ||
213 | + break; | ||
214 | + } | ||
209 | } | 215 | } |
210 | } | 216 | } |
211 | 217 |
@@ -426,7 +426,10 @@ class ShopModel | @@ -426,7 +426,10 @@ class ShopModel | ||
426 | } | 426 | } |
427 | } | 427 | } |
428 | 428 | ||
429 | - return $result; | 429 | + return array( |
430 | + 'title' => empty($result[0]['title']) ? '' : $result[0]['title'], | ||
431 | + 'list'=> $result | ||
432 | + ); | ||
430 | } | 433 | } |
431 | 434 | ||
432 | /** | 435 | /** |
@@ -571,13 +574,8 @@ class ShopModel | @@ -571,13 +574,8 @@ class ShopModel | ||
571 | $list = self::$fun(self::getResourceData($list), $parameters); | 574 | $list = self::$fun(self::getResourceData($list), $parameters); |
572 | switch ($fun) { | 575 | switch ($fun) { |
573 | case 'shopTopBanner': | 576 | case 'shopTopBanner': |
574 | - $data[$fun] = $list; | ||
575 | - break; | ||
576 | case 'signboard': | 577 | case 'signboard': |
577 | - $data[$fun] = array( | ||
578 | - 'title' => isset($list[0]['title']) ? $list[0]['title'] : '', | ||
579 | - 'list'=> $list | ||
580 | - ); | 578 | + $data[$fun] = $list; |
581 | break; | 579 | break; |
582 | } | 580 | } |
583 | } | 581 | } |
@@ -11,6 +11,7 @@ use WebPlugin\Cache; | @@ -11,6 +11,7 @@ use WebPlugin\Cache; | ||
11 | use WebPlugin\Images; | 11 | use WebPlugin\Images; |
12 | use Configs\WebCacheConfig; | 12 | use Configs\WebCacheConfig; |
13 | use Hood\Core\Security\AuthCode; | 13 | use Hood\Core\Security\AuthCode; |
14 | +use WebPlugin\UdpLog; | ||
14 | use Configs\ChannelConfig; | 15 | use Configs\ChannelConfig; |
15 | 16 | ||
16 | /** | 17 | /** |
@@ -58,6 +59,7 @@ class CartModel | @@ -58,6 +59,7 @@ class CartModel | ||
58 | $result['isEmpty'] = true; | 59 | $result['isEmpty'] = true; |
59 | $result['guangUrl'] = Helpers::url('', null, 'list'); | 60 | $result['guangUrl'] = Helpers::url('', null, 'list'); |
60 | $result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time())); | 61 | $result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time())); |
62 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'shoppingKey:'.$shoppingKey); | ||
61 | break; | 63 | break; |
62 | } | 64 | } |
63 | 65 | ||
@@ -225,6 +227,8 @@ class CartModel | @@ -225,6 +227,8 @@ class CartModel | ||
225 | $addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); | 227 | $addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); |
226 | if ($addCart && isset($addCart['code'])) { | 228 | if ($addCart && isset($addCart['code'])) { |
227 | $result = $addCart; | 229 | $result = $addCart; |
230 | + }else{ | ||
231 | + UdpLog::info('【购物车】校验参数传递auth','productSku:'.$productSku.'buyNumber:'.$buyNumber.'goodsType:'.$goodsType,'isEdit:'.$isEdit.'promotionId:'.$promotionId.'uid:'.$uid.'shoppingKey:'.$shoppingKey); | ||
228 | } | 232 | } |
229 | 233 | ||
230 | return $result; | 234 | return $result; |
@@ -245,6 +249,7 @@ class CartModel | @@ -245,6 +249,7 @@ class CartModel | ||
245 | 249 | ||
246 | do { | 250 | do { |
247 | if (empty($skuList)) { | 251 | if (empty($skuList)) { |
252 | + UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); | ||
248 | break; | 253 | break; |
249 | } | 254 | } |
250 | 255 | ||
@@ -252,6 +257,8 @@ class CartModel | @@ -252,6 +257,8 @@ class CartModel | ||
252 | if ($select && isset($select['code'])) { | 257 | if ($select && isset($select['code'])) { |
253 | $result['code'] = $select['code']; | 258 | $result['code'] = $select['code']; |
254 | $result['message'] = $select['message']; | 259 | $result['message'] = $select['message']; |
260 | + }else{ | ||
261 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion); | ||
255 | } | 262 | } |
256 | } while (false); | 263 | } while (false); |
257 | 264 | ||
@@ -274,6 +281,7 @@ class CartModel | @@ -274,6 +281,7 @@ class CartModel | ||
274 | 281 | ||
275 | do { | 282 | do { |
276 | if (empty($skuList)) { | 283 | if (empty($skuList)) { |
284 | + UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); | ||
277 | break; | 285 | break; |
278 | } | 286 | } |
279 | 287 | ||
@@ -284,6 +292,8 @@ class CartModel | @@ -284,6 +292,8 @@ class CartModel | ||
284 | if (isset($remove['data']['goods_count'])) { | 292 | if (isset($remove['data']['goods_count'])) { |
285 | $result['total_goods_num'] = $remove['data']['goods_count']; | 293 | $result['total_goods_num'] = $remove['data']['goods_count']; |
286 | } | 294 | } |
295 | + }else{ | ||
296 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion); | ||
287 | } | 297 | } |
288 | } while (false); | 298 | } while (false); |
289 | 299 | ||
@@ -307,11 +317,11 @@ class CartModel | @@ -307,11 +317,11 @@ class CartModel | ||
307 | $result['code'] = 403; | 317 | $result['code'] = 403; |
308 | $result['message'] = '请先登录!'; | 318 | $result['message'] = '请先登录!'; |
309 | $result['data']['url'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/shopping/cart'))); | 319 | $result['data']['url'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/shopping/cart'))); |
310 | - | ||
311 | break; | 320 | break; |
312 | } | 321 | } |
313 | 322 | ||
314 | if (empty($skuList)) { | 323 | if (empty($skuList)) { |
324 | + UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList); | ||
315 | break; | 325 | break; |
316 | } | 326 | } |
317 | 327 | ||
@@ -319,6 +329,8 @@ class CartModel | @@ -319,6 +329,8 @@ class CartModel | ||
319 | if ($add && isset($add['code'])) { | 329 | if ($add && isset($add['code'])) { |
320 | $result['code'] = $add['code']; | 330 | $result['code'] = $add['code']; |
321 | $result['message'] = $add['message']; | 331 | $result['message'] = $add['message']; |
332 | + }else{ | ||
333 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'hasPromotion:'.$hasPromotion); | ||
322 | } | 334 | } |
323 | } while (false); | 335 | } while (false); |
324 | 336 | ||
@@ -341,6 +353,7 @@ class CartModel | @@ -341,6 +353,7 @@ class CartModel | ||
341 | 353 | ||
342 | do { | 354 | do { |
343 | if (empty($sku)) { | 355 | if (empty($sku)) { |
356 | + UdpLog::info('【购物车】校验参数传递auth','sku:'.$sku); | ||
344 | break; | 357 | break; |
345 | } | 358 | } |
346 | 359 | ||
@@ -348,6 +361,8 @@ class CartModel | @@ -348,6 +361,8 @@ class CartModel | ||
348 | if ($modify && isset($modify['code'])) { | 361 | if ($modify && isset($modify['code'])) { |
349 | $result['code'] = $modify['code']; | 362 | $result['code'] = $modify['code']; |
350 | $result['message'] = $modify['message']; | 363 | $result['message'] = $modify['message']; |
364 | + }else{ | ||
365 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'sku:'.$sku,'increaseNum:'.$increaseNum.'decreaseNum:'.$decreaseNum.'shoppingKey:'.$shoppingKey); | ||
351 | } | 366 | } |
352 | } while (false); | 367 | } while (false); |
353 | 368 | ||
@@ -421,6 +436,7 @@ class CartModel | @@ -421,6 +436,7 @@ class CartModel | ||
421 | 436 | ||
422 | $browse = CartData::browseRecord($uid, $udid, $page, 6); | 437 | $browse = CartData::browseRecord($uid, $udid, $page, 6); |
423 | if (empty($browse['data']['product_list'])) { | 438 | if (empty($browse['data']['product_list'])) { |
439 | + UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'udid'.$udid.'page'.$page); | ||
424 | break; | 440 | break; |
425 | } | 441 | } |
426 | 442 | ||
@@ -885,16 +901,19 @@ class CartModel | @@ -885,16 +901,19 @@ class CartModel | ||
885 | 901 | ||
886 | do { | 902 | do { |
887 | if (empty($addressId)) { | 903 | if (empty($addressId)) { |
904 | + UdpLog::info('【结算信息】配送地址参数校验','addressId为空'); | ||
888 | $result['code'] = 401; | 905 | $result['code'] = 401; |
889 | $result['message'] = '配送地址不能为空'; | 906 | $result['message'] = '配送地址不能为空'; |
890 | break; | 907 | break; |
891 | } | 908 | } |
892 | if (empty($deliveryTimeId)) { | 909 | if (empty($deliveryTimeId)) { |
910 | + UdpLog::info('【结算信息】配送时间参数校验','deliveryTime为空'); | ||
893 | $result['code'] = 402; | 911 | $result['code'] = 402; |
894 | $result['message'] = '请选择配送时间'; | 912 | $result['message'] = '请选择配送时间'; |
895 | break; | 913 | break; |
896 | } | 914 | } |
897 | if (empty($deliveryWayId)) { | 915 | if (empty($deliveryWayId)) { |
916 | + UdpLog::info('【结算信息】配送方式参数校验','deliveryWay为空'); | ||
898 | $result['code'] = 403; | 917 | $result['code'] = 403; |
899 | $result['message'] = '请选择配送方式'; | 918 | $result['message'] = '请选择配送方式'; |
900 | break; | 919 | break; |
@@ -169,9 +169,10 @@ class PayModel | @@ -169,9 +169,10 @@ class PayModel | ||
169 | $orderCount = 0; | 169 | $orderCount = 0; |
170 | $orders = PayData::getOrderCountByUid($uid); | 170 | $orders = PayData::getOrderCountByUid($uid); |
171 | 171 | ||
172 | - if (isset($orders['data']) && !empty($orders['data'])) { | ||
173 | - $orderCount = $orders['data']['total']; | 172 | + if (!empty($orders['data']['count'])) { |
173 | + $orderCount = $orders['data']['count']; | ||
174 | } | 174 | } |
175 | + | ||
175 | $result['isOldUser'] = (intval($orderCount) > self::OLD_USER_LIMIT) ? true : false; | 176 | $result['isOldUser'] = (intval($orderCount) > self::OLD_USER_LIMIT) ? true : false; |
176 | // 订单数(用于订单统计) | 177 | // 订单数(用于订单统计) |
177 | $result['orderCount'] = $orderCount; | 178 | $result['orderCount'] = $orderCount; |
@@ -282,7 +283,10 @@ class PayModel | @@ -282,7 +283,10 @@ class PayModel | ||
282 | $paymentParameter = $alipayToken; | 283 | $paymentParameter = $alipayToken; |
283 | } | 284 | } |
284 | 285 | ||
285 | - $reqParams = new Reqparams($orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'], $paymentParameter, $isTest, $uid, $userName); | 286 | + $reqParams = new Reqparams( |
287 | + $orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'], | ||
288 | + $paymentParameter, $isTest, $uid, $userName, $orderDetail['data']['pay_expire'] | ||
289 | + ); | ||
286 | $reqPars = $payService->getPayRequestPars($reqParams); | 290 | $reqPars = $payService->getPayRequestPars($reqParams); |
287 | if (empty($reqPars)) { | 291 | if (empty($reqPars)) { |
288 | $result['error'] = true; | 292 | $result['error'] = true; |
@@ -71,7 +71,7 @@ class PaymentModel | @@ -71,7 +71,7 @@ class PaymentModel | ||
71 | 'price' => $val['goods_price'], | 71 | 'price' => $val['goods_price'], |
72 | 'number' => $val['buy_number'] | 72 | 'number' => $val['buy_number'] |
73 | ); | 73 | ); |
74 | - $pinyouGoodsArr[] = $val['product_id'] . ',' . $val['buy_number']; | 74 | + $pinyouGoodsArr[] = $val['product_skn'] . ',' . $val['buy_number']; |
75 | } | 75 | } |
76 | $result['goodsData'] = $goodsData; | 76 | $result['goodsData'] = $goodsData; |
77 | // skn列表 | 77 | // skn列表 |
@@ -173,9 +173,10 @@ class PaymentModel | @@ -173,9 +173,10 @@ class PaymentModel | ||
173 | //查询用户订单数接口 | 173 | //查询用户订单数接口 |
174 | $orders = PayData::getOrderCountByUid($uid); | 174 | $orders = PayData::getOrderCountByUid($uid); |
175 | 175 | ||
176 | - if (isset($orders['data']) && !empty($orders['data'])) { | ||
177 | - $orderCount = $orders['data']['total']; | 176 | + if (!empty($orders['data']['count'])) { |
177 | + $orderCount = $orders['data']['count']; | ||
178 | } | 178 | } |
179 | + | ||
179 | $result['isOldUser'] = (intval($orderCount) > self::OLD_USER_LIMIT) ? true : false; | 180 | $result['isOldUser'] = (intval($orderCount) > self::OLD_USER_LIMIT) ? true : false; |
180 | // 订单数(用于订单统计) | 181 | // 订单数(用于订单统计) |
181 | $result['orderCount'] = $orderCount; | 182 | $result['orderCount'] = $orderCount; |
@@ -324,14 +325,28 @@ class PaymentModel | @@ -324,14 +325,28 @@ class PaymentModel | ||
324 | $input->SetBody('有货订单号:' . $orderCode); | 325 | $input->SetBody('有货订单号:' . $orderCode); |
325 | $input->SetOut_trade_no('YOHOBuy_' . $orderCode); // 商户订单号 | 326 | $input->SetOut_trade_no('YOHOBuy_' . $orderCode); // 商户订单号 |
326 | $input->SetTotal_fee($totalFee); | 327 | $input->SetTotal_fee($totalFee); |
327 | - $input->SetTime_start(date("YmdHis")); | ||
328 | - $input->SetTime_expire(date("YmdHis", time() + 600)); | 328 | + //到期时间 |
329 | + if (!empty($orderDetail['data']['pay_expire']) && ($payExpireTime = strtotime($orderDetail['data']['pay_expire']))) { | ||
330 | + $payExpireTime = $payExpireTime; | ||
331 | + } else { | ||
332 | + $payExpireTime = time(); | ||
333 | + } | ||
334 | + | ||
335 | + $input->SetTime_start(date("YmdHis", strtotime('-2 hours', $payExpireTime))); | ||
336 | + //最短失效时间间隔必须大于5分钟 [https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_1] | ||
337 | + $input->SetTime_expire(date("YmdHis", $payExpireTime + 300)); | ||
329 | $input->SetTrade_type("NATIVE"); | 338 | $input->SetTrade_type("NATIVE"); |
330 | $input->SetProduct_id($orderCode); | 339 | $input->SetProduct_id($orderCode); |
331 | $notify = new WxPayNativePay(); | 340 | $notify = new WxPayNativePay(); |
332 | $payResult = $notify->GetPayUrl($input); | 341 | $payResult = $notify->GetPayUrl($input); |
342 | + //错误信息,EQ:超时 | ||
343 | + if (!empty($payResult['return_code']) && $payResult['return_code'] === 'FAIL') { | ||
344 | + self::$code['message'] = $payResult['return_msg']; | ||
345 | + break; | ||
346 | + } | ||
333 | 347 | ||
334 | - if ($payResult['result_code'] === 'FAIL') { | 348 | + //错误信息,EQ:多次涮新 |
349 | + if (!empty($payResult['result_code']) && $payResult['result_code'] === 'FAIL') { | ||
335 | self::$code['message'] = $payResult['err_code_des']; | 350 | self::$code['message'] = $payResult['err_code_des']; |
336 | break; | 351 | break; |
337 | } | 352 | } |
@@ -521,7 +536,10 @@ class PaymentModel | @@ -521,7 +536,10 @@ class PaymentModel | ||
521 | $paymentParameter = $alipayToken; | 536 | $paymentParameter = $alipayToken; |
522 | } | 537 | } |
523 | 538 | ||
524 | - $reqParams = new Reqparams($orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'], $paymentParameter, $isTest, $uid, $userName); | 539 | + $reqParams = new Reqparams( |
540 | + $orderCode, $totalFee, '有货订单号:' . $orderCode, '', $orderDetail['data']['create_time'], | ||
541 | + $paymentParameter, $isTest, $uid, $userName, $orderDetail['data']['pay_expire'] | ||
542 | + ); | ||
525 | $reqPars = $payService->getPayRequestPars($reqParams); | 543 | $reqPars = $payService->getPayRequestPars($reqParams); |
526 | UdpLog::info( | 544 | UdpLog::info( |
527 | "【支付-参数】,function:getPayData,orderCode:{$orderCode},接口返回", | 545 | "【支付-参数】,function:getPayData,orderCode:{$orderCode},接口返回", |
@@ -3,10 +3,11 @@ | @@ -3,10 +3,11 @@ | ||
3 | use Action\WebAction; | 3 | use Action\WebAction; |
4 | use WebPlugin\Helpers; | 4 | use WebPlugin\Helpers; |
5 | use Shopping\CartModel; | 5 | use Shopping\CartModel; |
6 | +use WebPlugin\UdpLog; | ||
6 | 7 | ||
7 | /** | 8 | /** |
8 | * 购物车相关的控制器 | 9 | * 购物车相关的控制器 |
9 | - * | 10 | + * |
10 | * @name IndexController | 11 | * @name IndexController |
11 | * @package Cart | 12 | * @package Cart |
12 | * @copyright yoho.inc | 13 | * @copyright yoho.inc |
@@ -23,13 +24,13 @@ class IndexController extends WebAction | @@ -23,13 +24,13 @@ class IndexController extends WebAction | ||
23 | { | 24 | { |
24 | $uid = $this->getUid(false); | 25 | $uid = $this->getUid(false); |
25 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 26 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
26 | - | 27 | + |
27 | // 显示一次并清除已删除的COOKIE记录 | 28 | // 显示一次并清除已删除的COOKIE记录 |
28 | $cartDelList = $this->getCookie('cart-del-list'); | 29 | $cartDelList = $this->getCookie('cart-del-list'); |
29 | if (!empty($cartDelList)) { | 30 | if (!empty($cartDelList)) { |
30 | $this->setCookie('cart-del-list', ''); | 31 | $this->setCookie('cart-del-list', ''); |
31 | } | 32 | } |
32 | - | 33 | + |
33 | $this->setTitle('购物车', true, ' | '); | 34 | $this->setTitle('购物车', true, ' | '); |
34 | $this->setSimpleHeader(); | 35 | $this->setSimpleHeader(); |
35 | $this->_view->display('cart', array( | 36 | $this->_view->display('cart', array( |
@@ -38,10 +39,10 @@ class IndexController extends WebAction | @@ -38,10 +39,10 @@ class IndexController extends WebAction | ||
38 | 'uid' => $uid ? $uid : '', | 39 | 'uid' => $uid ? $uid : '', |
39 | )); | 40 | )); |
40 | } | 41 | } |
41 | - | 42 | + |
42 | /** | 43 | /** |
43 | * 购物车商品选择与取消 | 44 | * 购物车商品选择与取消 |
44 | - * | 45 | + * |
45 | * @param string skuList 商品sku列表,json格式,如{"744403":1,"777777":3} | 46 | * @param string skuList 商品sku列表,json格式,如{"744403":1,"777777":3} |
46 | * @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口 | 47 | * @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口 |
47 | * @return json | 48 | * @return json |
@@ -60,10 +61,10 @@ class IndexController extends WebAction | @@ -60,10 +61,10 @@ class IndexController extends WebAction | ||
60 | 61 | ||
61 | $this->echoJson($result); | 62 | $this->echoJson($result); |
62 | } | 63 | } |
63 | - | 64 | + |
64 | /** | 65 | /** |
65 | * 修改购物车商品数量 | 66 | * 修改购物车商品数量 |
66 | - * | 67 | + * |
67 | * @param int sku 商品到尺码的编吗 | 68 | * @param int sku 商品到尺码的编吗 |
68 | * @param int increaseNum 增加1 | 69 | * @param int increaseNum 增加1 |
69 | * @param int decreaseNum 减少1 | 70 | * @param int decreaseNum 减少1 |
@@ -75,12 +76,12 @@ class IndexController extends WebAction | @@ -75,12 +76,12 @@ class IndexController extends WebAction | ||
75 | 76 | ||
76 | if ($this->isAjax()) { | 77 | if ($this->isAjax()) { |
77 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 78 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
78 | - | 79 | + |
79 | $uid = $this->getUid(false); | 80 | $uid = $this->getUid(false); |
80 | $sku = $this->post('sku', 0); | 81 | $sku = $this->post('sku', 0); |
81 | $increaseNum = $this->post('increaseNum', null); | 82 | $increaseNum = $this->post('increaseNum', null); |
82 | $decreaseNum = $this->post('decreaseNum', null); | 83 | $decreaseNum = $this->post('decreaseNum', null); |
83 | - | 84 | + |
84 | $result = CartModel::modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey); | 85 | $result = CartModel::modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey); |
85 | if (!empty($result['code']) && $result['code'] == 200) { | 86 | if (!empty($result['code']) && $result['code'] == 200) { |
86 | $this->setShoppingCookie($uid); | 87 | $this->setShoppingCookie($uid); |
@@ -89,10 +90,10 @@ class IndexController extends WebAction | @@ -89,10 +90,10 @@ class IndexController extends WebAction | ||
89 | 90 | ||
90 | $this->echoJson($result); | 91 | $this->echoJson($result); |
91 | } | 92 | } |
92 | - | 93 | + |
93 | /** | 94 | /** |
94 | * 移出购物车 | 95 | * 移出购物车 |
95 | - * | 96 | + * |
96 | * @param string skuList 商品sku列表,json格式,如[{"product_sku":1047193,"buy_number":1,"promotion_id":0}] | 97 | * @param string skuList 商品sku列表,json格式,如[{"product_sku":1047193,"buy_number":1,"promotion_id":0}] |
97 | * @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口 | 98 | * @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口 |
98 | * @return json | 99 | * @return json |
@@ -111,15 +112,15 @@ class IndexController extends WebAction | @@ -111,15 +112,15 @@ class IndexController extends WebAction | ||
111 | $this->setShoppingCookie($uid); | 112 | $this->setShoppingCookie($uid); |
112 | } | 113 | } |
113 | } | 114 | } |
114 | - | 115 | + |
115 | $this->echoJson($result); | 116 | $this->echoJson($result); |
116 | } | 117 | } |
117 | 118 | ||
118 | /** | 119 | /** |
119 | * 移入收藏夹 | 120 | * 移入收藏夹 |
120 | - * | 121 | + * |
121 | * 支持批量移入收藏夹 | 122 | * 支持批量移入收藏夹 |
122 | - * | 123 | + * |
123 | * @param string 商品sku列表,json格式,如{"744403":1,"777777":3} | 124 | * @param string 商品sku列表,json格式,如{"744403":1,"777777":3} |
124 | * @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口 | 125 | * @param bool hasPromotion 标识是不是有promotion_id参数, 后端会去调用不同的接口 |
125 | * @return json | 126 | * @return json |
@@ -140,32 +141,32 @@ class IndexController extends WebAction | @@ -140,32 +141,32 @@ class IndexController extends WebAction | ||
140 | 141 | ||
141 | $this->echoJson($result); | 142 | $this->echoJson($result); |
142 | } | 143 | } |
143 | - | 144 | + |
144 | /** | 145 | /** |
145 | * 检查是否收藏 | 146 | * 检查是否收藏 |
146 | - * | 147 | + * |
147 | * @param string sknList 商品productId列表,如["123123","123412"] | 148 | * @param string sknList 商品productId列表,如["123123","123412"] |
148 | */ | 149 | */ |
149 | public function checkFavAction() | 150 | public function checkFavAction() |
150 | { | 151 | { |
151 | $result = array('code' => 200, 'message' => '是否收藏', 'data' => array()); | 152 | $result = array('code' => 200, 'message' => '是否收藏', 'data' => array()); |
152 | - | 153 | + |
153 | if ($this->isAjax()) { | 154 | if ($this->isAjax()) { |
154 | $uid = $this->getUid(false); | 155 | $uid = $this->getUid(false); |
155 | $pidList = $this->post('pidList', ''); | 156 | $pidList = $this->post('pidList', ''); |
156 | $result['data'] = CartModel::checkUserIsFav($uid, $pidList); | 157 | $result['data'] = CartModel::checkUserIsFav($uid, $pidList); |
157 | } | 158 | } |
158 | - | 159 | + |
159 | $this->echoJson($result); | 160 | $this->echoJson($result); |
160 | } | 161 | } |
161 | - | 162 | + |
162 | /** | 163 | /** |
163 | * 凑单商品异步请求 | 164 | * 凑单商品异步请求 |
164 | */ | 165 | */ |
165 | public function getTogetherProductAction() | 166 | public function getTogetherProductAction() |
166 | { | 167 | { |
167 | - $result = array('code' => 200, 'data' => array(), 'message' => '凑单商品'); | ||
168 | - | 168 | + $result = array('code' => 200, 'data' => array(), 'message' => '凑单商品'); |
169 | + | ||
169 | if ($this->isAjax()) { | 170 | if ($this->isAjax()) { |
170 | $page = $this->get('page', 1); | 171 | $page = $this->get('page', 1); |
171 | $result = CartModel::getTogetherProduct($page); | 172 | $result = CartModel::getTogetherProduct($page); |
@@ -180,15 +181,15 @@ class IndexController extends WebAction | @@ -180,15 +181,15 @@ class IndexController extends WebAction | ||
180 | public function getHistroyProductAction() | 181 | public function getHistroyProductAction() |
181 | { | 182 | { |
182 | $result = array('code' => 200, 'data' => array(), 'message' => '浏览记录'); | 183 | $result = array('code' => 200, 'data' => array(), 'message' => '浏览记录'); |
183 | - | 184 | + |
184 | // 按照产品把明扬的指示,去掉最近浏览记录 | 185 | // 按照产品把明扬的指示,去掉最近浏览记录 |
185 | $this->echoJson($result); exit(); | 186 | $this->echoJson($result); exit(); |
186 | - | 187 | + |
187 | do { | 188 | do { |
188 | if (!$this->isAjax()) { | 189 | if (!$this->isAjax()) { |
189 | break; | 190 | break; |
190 | } | 191 | } |
191 | - | 192 | + |
192 | $page = $this->get('page', 1); | 193 | $page = $this->get('page', 1); |
193 | // $uid = $this->getUid(false); | 194 | // $uid = $this->getUid(false); |
194 | // if ($uid) { | 195 | // if ($uid) { |
@@ -196,7 +197,7 @@ class IndexController extends WebAction | @@ -196,7 +197,7 @@ class IndexController extends WebAction | ||
196 | // $result = CartModel::getBrowseProduct($uid, $udid, $page); | 197 | // $result = CartModel::getBrowseProduct($uid, $udid, $page); |
197 | // break; | 198 | // break; |
198 | // } | 199 | // } |
199 | - | 200 | + |
200 | $sknList = $this->getCookie('_browseskn'); | 201 | $sknList = $this->getCookie('_browseskn'); |
201 | if (empty($sknList)) { | 202 | if (empty($sknList)) { |
202 | break; | 203 | break; |
@@ -208,7 +209,7 @@ class IndexController extends WebAction | @@ -208,7 +209,7 @@ class IndexController extends WebAction | ||
208 | 209 | ||
209 | $this->echoJson($result); | 210 | $this->echoJson($result); |
210 | } | 211 | } |
211 | - | 212 | + |
212 | /** | 213 | /** |
213 | * 确认订单 | 214 | * 确认订单 |
214 | */ | 215 | */ |
@@ -216,68 +217,67 @@ class IndexController extends WebAction | @@ -216,68 +217,67 @@ class IndexController extends WebAction | ||
216 | { | 217 | { |
217 | $type = $this->get('type', 1); | 218 | $type = $this->get('type', 1); |
218 | $refer = Helpers::url('/cart/index/orderEnsure', array('type' => $type)); | 219 | $refer = Helpers::url('/cart/index/orderEnsure', array('type' => $type)); |
219 | - | 220 | + |
220 | // 审判用户是否已登录 | 221 | // 审判用户是否已登录 |
221 | $this->auditJumpLogin(false, $refer); | 222 | $this->auditJumpLogin(false, $refer); |
222 | - | 223 | + |
223 | $this->setTitle('填写订单', true, ' | '); | 224 | $this->setTitle('填写订单', true, ' | '); |
224 | $this->setSimpleHeader(); | 225 | $this->setSimpleHeader(); |
225 | - | 226 | + |
226 | $cartType = ($type == 2) ? 'advance' : 'ordinary'; | 227 | $cartType = ($type == 2) ? 'advance' : 'ordinary'; |
227 | $isAdvanceCart = ($type == 2) ? true : false; | 228 | $isAdvanceCart = ($type == 2) ? true : false; |
228 | $uid = $this->getUid(false); | 229 | $uid = $this->getUid(false); |
229 | - | 230 | + |
230 | $orderEnsure = CartModel::cartPay($uid, $cartType, $isAdvanceCart); | 231 | $orderEnsure = CartModel::cartPay($uid, $cartType, $isAdvanceCart); |
231 | if (empty($orderEnsure)) { | 232 | if (empty($orderEnsure)) { |
232 | $this->go(Helpers::url('/shopping/cart')); | 233 | $this->go(Helpers::url('/shopping/cart')); |
233 | } | 234 | } |
234 | 235 | ||
235 | $this->_view->display('order-ensure', array( | 236 | $this->_view->display('order-ensure', array( |
236 | - 'orderEnsurePage' => true, | 237 | + 'orderEnsurePage' => true, |
237 | 'orderEnsure' => $orderEnsure, | 238 | 'orderEnsure' => $orderEnsure, |
238 | - 'packages'=> $orderEnsure['packages'] | ||
239 | )); | 239 | )); |
240 | } | 240 | } |
241 | - | 241 | + |
242 | /** | 242 | /** |
243 | * 异步获取地址信息 | 243 | * 异步获取地址信息 |
244 | - * | 244 | + * |
245 | * @return json | 245 | * @return json |
246 | */ | 246 | */ |
247 | public function getAddressAction() | 247 | public function getAddressAction() |
248 | { | 248 | { |
249 | $result = array('code' => 200, 'data' => array(), 'message' => '地址信息'); | 249 | $result = array('code' => 200, 'data' => array(), 'message' => '地址信息'); |
250 | - | 250 | + |
251 | if ($this->isAjax()) { | 251 | if ($this->isAjax()) { |
252 | $uid = $this->getUid(false); | 252 | $uid = $this->getUid(false); |
253 | $result['data'] = CartModel::userAddressList($uid); | 253 | $result['data'] = CartModel::userAddressList($uid); |
254 | } | 254 | } |
255 | - | 255 | + |
256 | $this->echoJson($result); | 256 | $this->echoJson($result); |
257 | } | 257 | } |
258 | - | 258 | + |
259 | /** | 259 | /** |
260 | * 设置为默认的地址 | 260 | * 设置为默认的地址 |
261 | - * | 261 | + * |
262 | * @param int id 地址ID | 262 | * @param int id 地址ID |
263 | * @return json | 263 | * @return json |
264 | */ | 264 | */ |
265 | public function setDefaultAddressAction() | 265 | public function setDefaultAddressAction() |
266 | { | 266 | { |
267 | $result = array(); | 267 | $result = array(); |
268 | - | 268 | + |
269 | if ($this->isAjax()) { | 269 | if ($this->isAjax()) { |
270 | $uid = $this->getUid(false); | 270 | $uid = $this->getUid(false); |
271 | $addressId = $this->post('id'); | 271 | $addressId = $this->post('id'); |
272 | $result = CartModel::setDefaultAddress($uid, $addressId); | 272 | $result = CartModel::setDefaultAddress($uid, $addressId); |
273 | } | 273 | } |
274 | - | 274 | + |
275 | $this->echoJson($result); | 275 | $this->echoJson($result); |
276 | } | 276 | } |
277 | - | 277 | + |
278 | /** | 278 | /** |
279 | * 保存地址信息 | 279 | * 保存地址信息 |
280 | - * | 280 | + * |
281 | * @param int $id 地址ID ,当修改操作的时候需要传,添加时候不需要传 | 281 | * @param int $id 地址ID ,当修改操作的时候需要传,添加时候不需要传 |
282 | * @param string $address 地址信息 | 282 | * @param string $address 地址信息 |
283 | * @param int $areaCode 城市码 | 283 | * @param int $areaCode 城市码 |
@@ -292,7 +292,7 @@ class IndexController extends WebAction | @@ -292,7 +292,7 @@ class IndexController extends WebAction | ||
292 | public function saveAddressAction() | 292 | public function saveAddressAction() |
293 | { | 293 | { |
294 | $result = array(); | 294 | $result = array(); |
295 | - | 295 | + |
296 | if ($this->isAjax()) { | 296 | if ($this->isAjax()) { |
297 | $uid = $this->getUid(false); | 297 | $uid = $this->getUid(false); |
298 | $id = $this->post('id', null); | 298 | $id = $this->post('id', null); |
@@ -312,38 +312,38 @@ class IndexController extends WebAction | @@ -312,38 +312,38 @@ class IndexController extends WebAction | ||
312 | } | 312 | } |
313 | } | 313 | } |
314 | } | 314 | } |
315 | - | 315 | + |
316 | $this->echoJson($result); | 316 | $this->echoJson($result); |
317 | } | 317 | } |
318 | - | 318 | + |
319 | /** | 319 | /** |
320 | * 删除地址 | 320 | * 删除地址 |
321 | - * | 321 | + * |
322 | * @param int id 地址ID | 322 | * @param int id 地址ID |
323 | */ | 323 | */ |
324 | public function delAddressAction() | 324 | public function delAddressAction() |
325 | { | 325 | { |
326 | $result = array(); | 326 | $result = array(); |
327 | - | 327 | + |
328 | if ($this->isAjax()) { | 328 | if ($this->isAjax()) { |
329 | $uid = $this->getUid(false); | 329 | $uid = $this->getUid(false); |
330 | $addressId = $this->post('id'); | 330 | $addressId = $this->post('id'); |
331 | $result = CartModel::delAddress($uid, $addressId); | 331 | $result = CartModel::delAddress($uid, $addressId); |
332 | } | 332 | } |
333 | - | 333 | + |
334 | $this->echoJson($result); | 334 | $this->echoJson($result); |
335 | } | 335 | } |
336 | - | 336 | + |
337 | /** | 337 | /** |
338 | * 获取省市区县信息列表 | 338 | * 获取省市区县信息列表 |
339 | - * | 339 | + * |
340 | * @param int id | 340 | * @param int id |
341 | * @return json | 341 | * @return json |
342 | */ | 342 | */ |
343 | public function getAreaListAction() | 343 | public function getAreaListAction() |
344 | { | 344 | { |
345 | $result = array('code' => 200, 'message' => '地区信息', 'data' => array()); | 345 | $result = array('code' => 200, 'message' => '地区信息', 'data' => array()); |
346 | - | 346 | + |
347 | if ($this->isAjax()) { | 347 | if ($this->isAjax()) { |
348 | $id = $this->get('id', 0); | 348 | $id = $this->get('id', 0); |
349 | $result['data'] = CartModel::getAreaList($id); | 349 | $result['data'] = CartModel::getAreaList($id); |
@@ -351,16 +351,16 @@ class IndexController extends WebAction | @@ -351,16 +351,16 @@ class IndexController extends WebAction | ||
351 | 351 | ||
352 | $this->echoJson($result); | 352 | $this->echoJson($result); |
353 | } | 353 | } |
354 | - | 354 | + |
355 | /** | 355 | /** |
356 | * 获取优惠券列表 | 356 | * 获取优惠券列表 |
357 | - * | 357 | + * |
358 | * @return json | 358 | * @return json |
359 | */ | 359 | */ |
360 | public function getCouponListAction() | 360 | public function getCouponListAction() |
361 | { | 361 | { |
362 | $result = array('code' => 200, 'message' => '优惠券信息', 'data' => array()); | 362 | $result = array('code' => 200, 'message' => '优惠券信息', 'data' => array()); |
363 | - | 363 | + |
364 | if ($this->isAjax()) { | 364 | if ($this->isAjax()) { |
365 | $uid = $this->getUid(false); | 365 | $uid = $this->getUid(false); |
366 | $result['data'] = CartModel::getCouponList($uid); | 366 | $result['data'] = CartModel::getCouponList($uid); |
@@ -368,10 +368,10 @@ class IndexController extends WebAction | @@ -368,10 +368,10 @@ class IndexController extends WebAction | ||
368 | 368 | ||
369 | $this->echoJson($result); | 369 | $this->echoJson($result); |
370 | } | 370 | } |
371 | - | 371 | + |
372 | /** | 372 | /** |
373 | * 购物车选择改变字段,重新运算订单数据 | 373 | * 购物车选择改变字段,重新运算订单数据 |
374 | - * | 374 | + * |
375 | * @param string $cartType 购物车类型,ordinary表示普通, advance表示预售 | 375 | * @param string $cartType 购物车类型,ordinary表示普通, advance表示预售 |
376 | * @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运 | 376 | * @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运 |
377 | * @param int $paymentType 支付方式,1表示在线支付,2表示货到付款 | 377 | * @param int $paymentType 支付方式,1表示在线支付,2表示货到付款 |
@@ -389,21 +389,19 @@ class IndexController extends WebAction | @@ -389,21 +389,19 @@ class IndexController extends WebAction | ||
389 | $deliveryWay = $this->post('deliveryWay', 1); | 389 | $deliveryWay = $this->post('deliveryWay', 1); |
390 | $paymentType = $this->post('paymentType', 1); | 390 | $paymentType = $this->post('paymentType', 1); |
391 | $couponCode = $this->post('couponCode', null); | 391 | $couponCode = $this->post('couponCode', null); |
392 | - $promotionCode = $this->post('promotionCode', null); | ||
393 | $yohoCoin = $this->post('yohoCoin', null); | 392 | $yohoCoin = $this->post('yohoCoin', null); |
393 | + $promotionCode = $this->post('promotionCode', null); | ||
394 | $redEnvelopes = $this->post('redEnvelopes', null); | 394 | $redEnvelopes = $this->post('redEnvelopes', null); |
395 | $uid = $this->getUid(false); | 395 | $uid = $this->getUid(false); |
396 | - //优先取优惠码 | ||
397 | - $couponCode = $promotionCode ? null : $couponCode; | ||
398 | $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes); | 396 | $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes); |
399 | } | 397 | } |
400 | 398 | ||
401 | $this->echoJson($result); | 399 | $this->echoJson($result); |
402 | } | 400 | } |
403 | - | 401 | + |
404 | /** | 402 | /** |
405 | * 确认结算订单 | 403 | * 确认结算订单 |
406 | - * | 404 | + * |
407 | * @param int $addressId 地址ID | 405 | * @param int $addressId 地址ID |
408 | * @param int $cartType 购物车类型ID | 406 | * @param int $cartType 购物车类型ID |
409 | * @param int $deliveryTimeId 寄送时间ID | 407 | * @param int $deliveryTimeId 寄送时间ID |
@@ -429,54 +427,53 @@ class IndexController extends WebAction | @@ -429,54 +427,53 @@ class IndexController extends WebAction | ||
429 | if (!$this->isAjax()) { | 427 | if (!$this->isAjax()) { |
430 | break; | 428 | break; |
431 | } | 429 | } |
432 | - | 430 | + |
433 | // 判断用户是否登录 | 431 | // 判断用户是否登录 |
434 | $uid = $this->getUid(false); | 432 | $uid = $this->getUid(false); |
435 | if (!$uid) { | 433 | if (!$uid) { |
436 | $result['message'] = '请先登录'; | 434 | $result['message'] = '请先登录'; |
437 | break; | 435 | break; |
438 | } | 436 | } |
439 | - | 437 | + |
440 | $addressId = $this->post('addressId', null); | 438 | $addressId = $this->post('addressId', null); |
441 | $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 | 439 | $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 |
442 | $deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送 | 440 | $deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送 |
443 | $deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递 | 441 | $deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递 |
444 | $invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头 | 442 | $invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头 |
445 | - $invoiceId = $this->post('invoiceId', null); // 发票类型 | 443 | + $invoiceId = $this->post('invoiceId', null); // 发票类型 |
446 | $paymentId = $this->post('paymentId', 15); // 支付ID | 444 | $paymentId = $this->post('paymentId', 15); // 支付ID |
447 | $paymentType = $this->post('paymentType', 1); // 默认在线支付 | 445 | $paymentType = $this->post('paymentType', 1); // 默认在线支付 |
448 | $remark = $this->post('remark', ''); // 备注信息 | 446 | $remark = $this->post('remark', ''); // 备注信息 |
449 | - $couponCode = $this->post('couponCode', null); // 优惠券码 | ||
450 | - $promotionCode = $this->post('promotionCode', null);//优惠码 | 447 | + $couponCode = $this->post('couponCode', null); // 优惠券 |
448 | + $promotionCode = $this->post('promotionCode', null); // 优惠码 | ||
451 | $yohoCoin = $this->post('yohoCoin', 1); // YOHO币 | 449 | $yohoCoin = $this->post('yohoCoin', 1); // YOHO币 |
452 | $isPreContact = $this->post('isPreContact', false); // 送货前是否联系 | 450 | $isPreContact = $this->post('isPreContact', false); // 送货前是否联系 |
453 | $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格 | 451 | $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格 |
454 | $redEnvelopes = $this->post('redEnvelopes', null); | 452 | $redEnvelopes = $this->post('redEnvelopes', null); |
455 | - //优先优惠码 | ||
456 | - $couponCode = $promotionCode?null:$couponCode; | 453 | + |
457 | // 调用下单接口 | 454 | // 调用下单接口 |
458 | - $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, | ||
459 | - $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); | ||
460 | - | 455 | + $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, |
456 | + $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); | ||
461 | // 判断是否下单成功 | 457 | // 判断是否下单成功 |
462 | if (empty($result['data']['order_code'])) { | 458 | if (empty($result['data']['order_code'])) { |
459 | + UdpLog::info('【结算信息】判断是否下单成功','order_code'.$result['data']['order_code']); | ||
463 | break; | 460 | break; |
464 | } | 461 | } |
465 | - | 462 | + |
466 | // 跳转到支付的URL链接 | 463 | // 跳转到支付的URL链接 |
467 | $result['data']['payUrl'] = Helpers::url('/shopping/pay', array('ordercode' => $result['data']['order_code'])); | 464 | $result['data']['payUrl'] = Helpers::url('/shopping/pay', array('ordercode' => $result['data']['order_code'])); |
468 | } | 465 | } |
469 | while (false); | 466 | while (false); |
470 | - | 467 | + |
471 | // $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin); | 468 | // $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin); |
472 | // | 469 | // |
473 | -// // 记录下单异常的数据 | ||
474 | -// if (empty($result)) { | ||
475 | -// $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime | ||
476 | -// . ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin | ||
477 | -// . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; | ||
478 | -// error_log($message, 3, '/Data/logs/php/pc_error/order.' . date('Ym') . '.log'); | ||
479 | -// } | 470 | + // 记录下单异常的数据 |
471 | + if (empty($result)) { | ||
472 | + $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime | ||
473 | + . ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin | ||
474 | + . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; | ||
475 | + UdpLog::info('【下单】下单异常数据','message:'.$message,'返回:'.json_encode($result)); | ||
476 | + } | ||
480 | // // 返回数据 | 477 | // // 返回数据 |
481 | // else { | 478 | // else { |
482 | // // 提交成功清除Cookie | 479 | // // 提交成功清除Cookie |
@@ -492,10 +489,10 @@ class IndexController extends WebAction | @@ -492,10 +489,10 @@ class IndexController extends WebAction | ||
492 | // // do nothing | 489 | // // do nothing |
493 | // } | 490 | // } |
494 | // } | 491 | // } |
495 | - | 492 | + |
496 | $this->echoJson($result); | 493 | $this->echoJson($result); |
497 | } | 494 | } |
498 | - | 495 | + |
499 | /** | 496 | /** |
500 | * 加入购物车 | 497 | * 加入购物车 |
501 | * | 498 | * |
@@ -539,12 +536,12 @@ class IndexController extends WebAction | @@ -539,12 +536,12 @@ class IndexController extends WebAction | ||
539 | 536 | ||
540 | $this->echoJson($result); | 537 | $this->echoJson($result); |
541 | } | 538 | } |
542 | - | 539 | + |
543 | /** | 540 | /** |
544 | * 获取商品信息 | 541 | * 获取商品信息 |
545 | */ | 542 | */ |
546 | public function getProductInfoAction() | 543 | public function getProductInfoAction() |
547 | - { | 544 | + { |
548 | $productId = $this->get('productId'); | 545 | $productId = $this->get('productId'); |
549 | $uid = $this->getUid(); | 546 | $uid = $this->getUid(); |
550 | $vipLevel = -1; | 547 | $vipLevel = -1; |
@@ -557,10 +554,10 @@ class IndexController extends WebAction | @@ -557,10 +554,10 @@ class IndexController extends WebAction | ||
557 | } | 554 | } |
558 | $this->_view->display('goods-detail', $data); | 555 | $this->_view->display('goods-detail', $data); |
559 | } | 556 | } |
560 | - | 557 | + |
561 | /** | 558 | /** |
562 | * 获取购物车商品总数 | 559 | * 获取购物车商品总数 |
563 | - * | 560 | + * |
564 | * @return jsonp | 561 | * @return jsonp |
565 | */ | 562 | */ |
566 | public function countAction() | 563 | public function countAction() |
@@ -569,10 +566,10 @@ class IndexController extends WebAction | @@ -569,10 +566,10 @@ class IndexController extends WebAction | ||
569 | $uid = $this->getUid(false); | 566 | $uid = $this->getUid(false); |
570 | $shoppingKey = Helpers::getShoppingKeyByCookie(); | 567 | $shoppingKey = Helpers::getShoppingKeyByCookie(); |
571 | $result = CartModel::getCartCount($uid, $shoppingKey); | 568 | $result = CartModel::getCartCount($uid, $shoppingKey); |
572 | - | 569 | + |
573 | $this->helpJsonCallbackResult($callback, 200, '总数', $result); | 570 | $this->helpJsonCallbackResult($callback, 200, '总数', $result); |
574 | } | 571 | } |
575 | - | 572 | + |
576 | /** | 573 | /** |
577 | * 设置购物车COOKIE信息 | 574 | * 设置购物车COOKIE信息 |
578 | */ | 575 | */ |
@@ -590,5 +587,5 @@ class IndexController extends WebAction | @@ -590,5 +587,5 @@ class IndexController extends WebAction | ||
590 | ))); | 587 | ))); |
591 | } | 588 | } |
592 | } | 589 | } |
593 | - | ||
594 | -} | ||
590 | + | ||
591 | +} |
@@ -7,6 +7,7 @@ use Passport\PassportModel; | @@ -7,6 +7,7 @@ use Passport\PassportModel; | ||
7 | use Configs\ChannelConfig; | 7 | use Configs\ChannelConfig; |
8 | use WebPlugin\Helpers; | 8 | use WebPlugin\Helpers; |
9 | use WebPlugin\Cache; | 9 | use WebPlugin\Cache; |
10 | +use WebPlugin\UdpLog; | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * 登录 | 13 | * 登录 |
@@ -113,6 +114,7 @@ class LoginController extends WebAction | @@ -113,6 +114,7 @@ class LoginController extends WebAction | ||
113 | $verifyCode = trim($this->post('captcha')); | 114 | $verifyCode = trim($this->post('captcha')); |
114 | $isRemember = $this->post('isRemember'); | 115 | $isRemember = $this->post('isRemember'); |
115 | if (!is_numeric($area) || empty($account) || empty($password)) { | 116 | if (!is_numeric($area) || empty($account) || empty($password)) { |
117 | + UdpLog::info('【登录】校验参数传递auth','area:'.$area.'account:'.$account.'password:'.$password); | ||
116 | break; | 118 | break; |
117 | } | 119 | } |
118 | 120 | ||
@@ -124,6 +126,7 @@ class LoginController extends WebAction | @@ -124,6 +126,7 @@ class LoginController extends WebAction | ||
124 | $verifyMobile = is_numeric($account); | 126 | $verifyMobile = is_numeric($account); |
125 | } | 127 | } |
126 | if (!$verifyEmail && !$verifyMobile) { | 128 | if (!$verifyEmail && !$verifyMobile) { |
129 | + UdpLog::info('【登录】校验账号是否有效auth','email:'.$verifyEmail.'mobile:'.$verifyMobile); | ||
127 | break; | 130 | break; |
128 | } | 131 | } |
129 | 132 | ||
@@ -165,6 +168,7 @@ class LoginController extends WebAction | @@ -165,6 +168,7 @@ class LoginController extends WebAction | ||
165 | if ($verifyCode) { | 168 | if ($verifyCode) { |
166 | $picFlag = PassportModel::verifyCode($verifyCode); | 169 | $picFlag = PassportModel::verifyCode($verifyCode); |
167 | if (!$picFlag) { | 170 | if (!$picFlag) { |
171 | + UdpLog::info('【登录】登录验证码','area:'.$area.'account:'.$account.'verifyCode:'.$verifyCode); | ||
168 | $data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha')); | 172 | $data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha')); |
169 | break; | 173 | break; |
170 | } | 174 | } |
@@ -6,6 +6,7 @@ use WebPlugin\Helpers; | @@ -6,6 +6,7 @@ use WebPlugin\Helpers; | ||
6 | use WebPlugin\Cache; | 6 | use WebPlugin\Cache; |
7 | use Passport\PassportModel; | 7 | use Passport\PassportModel; |
8 | use LibModels\Web\Passport\BindData; | 8 | use LibModels\Web\Passport\BindData; |
9 | +use WebPlugin\UdpLog; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * 注册 | 12 | * 注册 |
@@ -265,6 +266,7 @@ class RegisterController extends WebAction | @@ -265,6 +266,7 @@ class RegisterController extends WebAction | ||
265 | $mobile = trim($this->post('mobile')); | 266 | $mobile = trim($this->post('mobile')); |
266 | $area = trim($this->post('area')); | 267 | $area = trim($this->post('area')); |
267 | if (!is_numeric($mobile) || !is_numeric($area)) { | 268 | if (!is_numeric($mobile) || !is_numeric($area)) { |
269 | + UdpLog::info('【注册】参数校验', 'mobile:'.$mobile.'area:'.$area); | ||
268 | $data['message'] = '手机号码格式不正确'; | 270 | $data['message'] = '手机号码格式不正确'; |
269 | break; | 271 | break; |
270 | } | 272 | } |
@@ -272,6 +274,7 @@ class RegisterController extends WebAction | @@ -272,6 +274,7 @@ class RegisterController extends WebAction | ||
272 | /* 判断是否是有效的注册方式,防注册机刷 */ | 274 | /* 判断是否是有效的注册方式,防注册机刷 */ |
273 | $effectiveTime = $this->getSession('effective_time'); | 275 | $effectiveTime = $this->getSession('effective_time'); |
274 | if ($effectiveTime < time() || empty($effectiveTime)) { | 276 | if ($effectiveTime < time() || empty($effectiveTime)) { |
277 | + UdpLog::info('【注册】超时', 'mobile:'.$mobile.'area:'.$area); | ||
275 | $data['message'] = '注册超时'; | 278 | $data['message'] = '注册超时'; |
276 | break; | 279 | break; |
277 | } | 280 | } |
@@ -279,6 +282,7 @@ class RegisterController extends WebAction | @@ -279,6 +282,7 @@ class RegisterController extends WebAction | ||
279 | //检测验证码不正确 | 282 | //检测验证码不正确 |
280 | $verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码 | 283 | $verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码 |
281 | if (!PassportModel::verifyCode($verifyCode)) { | 284 | if (!PassportModel::verifyCode($verifyCode)) { |
285 | + UdpLog::info('【注册】验证码不正确', 'mobile:'.$mobile.'area:'.$area.'verifyCode:'.$verifyCode); | ||
282 | $data['message'] = '验证码不正确'; | 286 | $data['message'] = '验证码不正确'; |
283 | break; | 287 | break; |
284 | } | 288 | } |
@@ -287,6 +291,7 @@ class RegisterController extends WebAction | @@ -287,6 +291,7 @@ class RegisterController extends WebAction | ||
287 | $code = trim($this->post('code')); //手机验证码 | 291 | $code = trim($this->post('code')); //手机验证码 |
288 | $password = $this->post('password'); | 292 | $password = $this->post('password'); |
289 | if (!Helpers::verifyPassword($password)) { | 293 | if (!Helpers::verifyPassword($password)) { |
294 | + UdpLog::info('【注册】密码格式问题', 'mobile:'.$mobile.'area:'.$area.'password:'.$password); | ||
290 | $data['message'] = '密码不正确'; | 295 | $data['message'] = '密码不正确'; |
291 | break; | 296 | break; |
292 | } | 297 | } |
@@ -302,6 +307,7 @@ class RegisterController extends WebAction | @@ -302,6 +307,7 @@ class RegisterController extends WebAction | ||
302 | $ipTimes = intval($ipTimes); | 307 | $ipTimes = intval($ipTimes); |
303 | } | 308 | } |
304 | if ($ipTimes >= 500) { | 309 | if ($ipTimes >= 500) { |
310 | + UdpLog::info('【注册】ip限制', 'mobile:'.$mobile.'area:'.$area.'ip:'.$ip.'ipTimes:'.$ipTimes); | ||
305 | $data['message'] = '由于你IP受限无法注册'; | 311 | $data['message'] = '由于你IP受限无法注册'; |
306 | break; | 312 | break; |
307 | } | 313 | } |
@@ -309,6 +315,7 @@ class RegisterController extends WebAction | @@ -309,6 +315,7 @@ class RegisterController extends WebAction | ||
309 | /* 验证注册的标识码是否有效 */ | 315 | /* 验证注册的标识码是否有效 */ |
310 | $data = RegData::validMobileCode($area, $mobile, $code); | 316 | $data = RegData::validMobileCode($area, $mobile, $code); |
311 | if (!isset($data['code']) || $data['code'] != 200) { | 317 | if (!isset($data['code']) || $data['code'] != 200) { |
318 | + UdpLog::info('【注册】短信验证码校验', 'mobile:'.$mobile.'area:'.$area.'code:'.$code); | ||
312 | $data['message'] = '验证码错误'; | 319 | $data['message'] = '验证码错误'; |
313 | break; | 320 | break; |
314 | } | 321 | } |
@@ -5,7 +5,7 @@ use Shopping\PayModel; | @@ -5,7 +5,7 @@ use Shopping\PayModel; | ||
5 | use WebPlugin\Pay\PayFactory; | 5 | use WebPlugin\Pay\PayFactory; |
6 | use WebPlugin\Pay\Rspparams; | 6 | use WebPlugin\Pay\Rspparams; |
7 | use WebPlugin\Pay\weixin\PayNotifyCallBack; | 7 | use WebPlugin\Pay\weixin\PayNotifyCallBack; |
8 | - | 8 | +use WebPlugin\UdpLog; |
9 | /** | 9 | /** |
10 | * 支付Notice | 10 | * 支付Notice |
11 | */ | 11 | */ |
@@ -24,6 +24,7 @@ class NoticeController extends WebAction | @@ -24,6 +24,7 @@ class NoticeController extends WebAction | ||
24 | public function alipaynoticeAction() | 24 | public function alipaynoticeAction() |
25 | { | 25 | { |
26 | $res = $this->getParseResponse($_POST, 2); | 26 | $res = $this->getParseResponse($_POST, 2); |
27 | + UdpLog::info("【支付宝异步】,function:alipaynoticeAction,参数", array('pars' => $_POST, 'res' => $res)); | ||
27 | if ($res->payResult != -1) { | 28 | if ($res->payResult != -1) { |
28 | $this->payResultProc($res, 2); | 29 | $this->payResultProc($res, 2); |
29 | echo "success"; | 30 | echo "success"; |
@@ -37,6 +38,7 @@ class NoticeController extends WebAction | @@ -37,6 +38,7 @@ class NoticeController extends WebAction | ||
37 | public function alipayreturnAction() | 38 | public function alipayreturnAction() |
38 | { | 39 | { |
39 | $res = $this->getParseResponse($_GET, 2); | 40 | $res = $this->getParseResponse($_GET, 2); |
41 | + UdpLog::info("【支付宝同步】,function:alipayreturnAction,参数", array('pars' => $_GET, 'res' => $res)); | ||
40 | $dealResult = $this->payResultProc($res, 2); | 42 | $dealResult = $this->payResultProc($res, 2); |
41 | $dealResult['payData'] = array('payWay' => '支付宝'); | 43 | $dealResult['payData'] = array('payWay' => '支付宝'); |
42 | $this->commonShowResult($dealResult); | 44 | $this->commonShowResult($dealResult); |
@@ -48,6 +50,7 @@ class NoticeController extends WebAction | @@ -48,6 +50,7 @@ class NoticeController extends WebAction | ||
48 | public function alibarcodenoticeAction() | 50 | public function alibarcodenoticeAction() |
49 | { | 51 | { |
50 | $res = $this->getParseResponse($_POST, 17); | 52 | $res = $this->getParseResponse($_POST, 17); |
53 | + UdpLog::info("【支付宝二维码支付异步】,function:alibarcodenoticeAction,参数", array('pars' => $_POST, 'res' => $res)); | ||
51 | if ($res->payResult != -1) { | 54 | if ($res->payResult != -1) { |
52 | $this->payResultProc($res, 17); | 55 | $this->payResultProc($res, 17); |
53 | echo "success"; | 56 | echo "success"; |
@@ -61,6 +64,7 @@ class NoticeController extends WebAction | @@ -61,6 +64,7 @@ class NoticeController extends WebAction | ||
61 | public function alibarcodereturnAction() | 64 | public function alibarcodereturnAction() |
62 | { | 65 | { |
63 | $res = $this->getParseResponse($_GET, 17); | 66 | $res = $this->getParseResponse($_GET, 17); |
67 | + UdpLog::info("【支付宝二维码支付同步】,function:alibarcodereturnAction,参数", array('pars' => $_GET, 'res' => $res)); | ||
64 | $dealResult = $this->payResultProc($res, 17); | 68 | $dealResult = $this->payResultProc($res, 17); |
65 | $dealResult['payData'] = array('payWay' => '支付宝'); | 69 | $dealResult['payData'] = array('payWay' => '支付宝'); |
66 | $this->commonShowResult($dealResult); | 70 | $this->commonShowResult($dealResult); |
@@ -225,6 +229,7 @@ class NoticeController extends WebAction | @@ -225,6 +229,7 @@ class NoticeController extends WebAction | ||
225 | $uid = $this->getSession(self::SESSION_UID_KEY); | 229 | $uid = $this->getSession(self::SESSION_UID_KEY); |
226 | $this->setSession(self::SESSION_UID_KEY, null); | 230 | $this->setSession(self::SESSION_UID_KEY, null); |
227 | } | 231 | } |
232 | + UdpLog::info("【微信扫码支付结果商户通知地址】,function:wechatqrcodenotifyAction"); | ||
228 | $notify = new PayNotifyCallBack($uid); | 233 | $notify = new PayNotifyCallBack($uid); |
229 | $notify->handle(false); | 234 | $notify->handle(false); |
230 | } | 235 | } |
@@ -248,6 +253,7 @@ class NoticeController extends WebAction | @@ -248,6 +253,7 @@ class NoticeController extends WebAction | ||
248 | $payment = PayModel::getPaymentById(21); | 253 | $payment = PayModel::getPaymentById(21); |
249 | $payService = PayFactory::factory($payment); | 254 | $payService = PayFactory::factory($payment); |
250 | $res = $payService->parseResponse(array('orderCode' => $orderCode)); | 255 | $res = $payService->parseResponse(array('orderCode' => $orderCode)); |
256 | + UdpLog::info("【微信扫码支付返回】,function:wechatqrcodereturnAction,参数", array('pars' => $_GET, 'res' => $res)); | ||
251 | $dealResult = $this->payResultProc($res, 21); | 257 | $dealResult = $this->payResultProc($res, 21); |
252 | $dealResult['payData'] = array('payWay' => '微信扫码支付'); | 258 | $dealResult['payData'] = array('payWay' => '微信扫码支付'); |
253 | } while (false); | 259 | } while (false); |
@@ -95,7 +95,7 @@ class IndexController extends WebAction | @@ -95,7 +95,7 @@ class IndexController extends WebAction | ||
95 | 95 | ||
96 | //调用模型获得品牌页数据 | 96 | //调用模型获得品牌页数据 |
97 | $data = BrandsModel::getBrandSearchData($condition, $options); | 97 | $data = BrandsModel::getBrandSearchData($condition, $options); |
98 | - | 98 | + $data['signboard'] = isset($result['signboard']) ? $result['signboard'] : '';//水牌 |
99 | //统计前三个商品 | 99 | //统计前三个商品 |
100 | $skn=array(); | 100 | $skn=array(); |
101 | $arr=array(); | 101 | $arr=array(); |
@@ -315,7 +315,6 @@ class IndexController extends WebAction | @@ -315,7 +315,6 @@ class IndexController extends WebAction | ||
315 | */ | 315 | */ |
316 | public function shopHome($shopId) | 316 | public function shopHome($shopId) |
317 | { | 317 | { |
318 | - $domain = $this->param('named'); | ||
319 | // 设置头部数据 | 318 | // 设置头部数据 |
320 | $this->setWebNavHeader(); | 319 | $this->setWebNavHeader(); |
321 | $misort = $this->get('misort'); | 320 | $misort = $this->get('misort'); |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.24" | 53 | +application.version = "0.0.27" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.25" | 53 | +application.version = "0.0.27" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.25" | 53 | +application.version = "0.0.27" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
@@ -50,7 +50,7 @@ application.template.ext = ".phtml" | @@ -50,7 +50,7 @@ application.template.ext = ".phtml" | ||
50 | application.assets.path = ROOT_PATH "/assets/web" | 50 | application.assets.path = ROOT_PATH "/assets/web" |
51 | 51 | ||
52 | ; 应用的版本号 | 52 | ; 应用的版本号 |
53 | -application.version = "0.0.25" | 53 | +application.version = "0.0.27" |
54 | 54 | ||
55 | ; 网站SEO信息 | 55 | ; 网站SEO信息 |
56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" | 56 | application.seo.title = "YOHO!有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证" |
-
Please register or login to post a comment