Authored by 郭成尧

Merge branch 'master' into hotfix/shopPd

@@ -50,7 +50,6 @@ const _repaymentList = (req, res, opt, params) => { @@ -50,7 +50,6 @@ const _repaymentList = (req, res, opt, params) => {
50 // 开通分期首页 50 // 开通分期首页
51 const index = (req, res) => { 51 const index = (req, res) => {
52 let uid = req.query.uid; 52 let uid = req.query.uid;
53 -  
54 Promise.all([ 53 Promise.all([
55 installmentModel.getStauts(uid), 54 installmentModel.getStauts(uid),
56 installmentModel.getSearchIntallment({ 55 installmentModel.getSearchIntallment({
@@ -309,14 +308,23 @@ const getRepayRecord = (req, res) => { @@ -309,14 +308,23 @@ const getRepayRecord = (req, res) => {
309 // 账号管理 308 // 账号管理
310 const account = (req, res) => { 309 const account = (req, res) => {
311 var url = req.yoho.isApp || req.cookies.appVersion ? '/home/installment/account' : '/home/installment/bank-card'; 310 var url = req.yoho.isApp || req.cookies.appVersion ? '/home/installment/account' : '/home/installment/bank-card';
  311 + if (req.cookies.appVersion) {
  312 + var versions = req.cookies.appVersion.split('.');
  313 + if (versions.length >= 2) {
  314 + if (versions[0] < 5 || (parseInt(versions[0], 10)===5 && versions[1] <= 1)) {
312 315
  316 + } else {
  317 + url = helpers.appUrlFormat(url, 'go.instalmentMyCard')
  318 + }
  319 + }
  320 + }
313 res.render('installment/account', { 321 res.render('installment/account', {
314 module: 'home', 322 module: 'home',
315 page: 'account', 323 page: 'account',
316 title: '账号管理', 324 title: '账号管理',
317 isInstallmentPage: true, 325 isInstallmentPage: true,
318 posId: 7, 326 posId: 7,
319 - url: helpers.appUrlFormat(url, 'go.instalmentMyCard') 327 + url: url
320 }); 328 });
321 }; 329 };
322 330
@@ -9,8 +9,8 @@ exports.getQr = (params) => { @@ -9,8 +9,8 @@ exports.getQr = (params) => {
9 9
10 try { 10 try {
11 uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token)); 11 uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token));
  12 + uid = parseInt(uid, 10)
12 } catch (e) { 13 } catch (e) {
13 - console.error(e);  
14 uid = params.token; 14 uid = params.token;
15 } 15 }
16 16
@@ -109,6 +109,10 @@ const _searchGoods = (params) => { @@ -109,6 +109,10 @@ const _searchGoods = (params) => {
109 delete params.channel; 109 delete params.channel;
110 } 110 }
111 111
  112 + if (params.query) {
  113 + params.query = params.query.replace(/\+/g, ',');
  114 + }
  115 +
112 params = _.assign({ 116 params = _.assign({
113 limit: '60', 117 limit: '60',
114 status: 1, 118 status: 1,