Authored by huangyi

新品节活动 api修改

... ... @@ -12,6 +12,9 @@ const guochaoController = {
async addFav(req, res, next) {
let param = req.body;
let sessionKey = param.sessionKey;
let appVersion = param.appVersion;
let appSessionType = param.sessionType;
// 调用接口传参时切勿使用toString获得字符串
let uid = {
... ... @@ -19,6 +22,8 @@ const guochaoController = {
return _.parseInt(req.body.uid);
},
sessionKey,
appVersion,
appSessionType
};
try {
... ... @@ -33,11 +38,15 @@ const guochaoController = {
checkFav: async function(req, res, next) {
let param = req.body;
let sessionKey = param.sessionKey;
let appVersion = param.appVersion;
let appSessionType = param.sessionType;
let uid = {
toString: () => {
return _.parseInt(req.body.uid);
},
sessionKey,
appVersion,
appSessionType
};
let ids = [1292, 282, 3082, 3372, 3548, 25, 3350, 1898, 1330, 1306, 1482, 992, 1474, 1472, 97, 1298, 1248, 3520, 2642, 964, 990, 1262, 1494, 292, 3146, 369, 720, 1282, 2312, 1878, 3210, 3576, 468, 3196, 1938, 3012];
... ...
... ... @@ -15,6 +15,8 @@ class Guochao extends global.yoho.BaseModel {
type: type }
});
console.log(result);
if (result.code === 200) {
let obj = {};
... ... @@ -57,6 +59,7 @@ class Guochao extends global.yoho.BaseModel {
let item = await actGuochaoShop.findOne({where: {shop_id: id}});
let result = await item.increment('collect_count');
return Promise.resolve({code: 200, result: true, data: result});
} catch (e) {
return Promise.resolve({code: 202, result: false, errorMsg: e});
... ...
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80012
Source Host : 0.0.0.0:3306
Source Schema : yoho_activity_platform
Target Server Type : MySQL
Target Server Version : 80012
File Encoding : 65001
Date: 11/09/2018 17:58:33
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for act_guochao_shop
-- ----------------------------
DROP TABLE IF EXISTS `act_guochao_shop`;
CREATE TABLE `act_guochao_shop` (
`id` int(8) NOT NULL AUTO_INCREMENT,
`shop_id` int(8) NOT NULL,
`collect_count` int(10) NOT NULL DEFAULT '0',
`logo` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`sort` int(8) NOT NULL DEFAULT '0',
`place` int(2) NOT NULL DEFAULT '0',
`shop_name` varchar(50) DEFAULT NULL,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of act_guochao_shop
-- ----------------------------
BEGIN;
INSERT INTO `act_guochao_shop` VALUES (1, 1292, 0, '//img01.yohoboys.com/o_1cn35spav53of01gtr42315dt8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1292&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1292\",\"shop_template_type\":\"1\",\"shop_name\":\"Stussy\",\"is_red_shop\":\"1\"}}', 5, 0, 'Stussy', '2018-09-07 02:24:25');
INSERT INTO `act_guochao_shop` VALUES (2, 282, 0, '//img01.yohoboys.com/o_1cn35hscqot61fe7bh21jbkra8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=282&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"282\",\"shop_template_type\":\"1\",\"shop_name\":\"Randomevent\",\"is_red_shop\":\"1\"}}', 10, 0, 'Randomevent', '2018-09-09 13:46:13');
INSERT INTO `act_guochao_shop` VALUES (3, 3082, 0, '//img01.yohoboys.com/o_1cn35md5cio3u3niqlqibtbr8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3082&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3082\",\"shop_template_type\":\"1\",\"shop_name\":\"MYGE\",\"is_red_shop\":\"1\"}}', 9, 0, 'MYGE', '2018-09-10 14:18:33');
INSERT INTO `act_guochao_shop` VALUES (4, 3372, 0, '//img01.yohoboys.com/o_1cn35v8qg50mvvb1s681dp5md48.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3372&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3372\",\"shop_template_type\":\"1\",\"shop_name\":\"ripndip\",\"is_red_shop\":\"1\"}}', 4, 0, 'RIPNDIP', '2018-09-10 14:19:23');
INSERT INTO `act_guochao_shop` VALUES (5, 3548, 0, '//img01.yohoboys.com/o_1cn35ockf35p10vg1j9s11iu1hk78.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3548&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3548\",\"shop_template_type\":\"1\",\"shop_name\":\"FMACM\",\"is_red_shop\":\"1\"}}', 8, 0, 'FMACM', '2018-09-10 14:19:53');
INSERT INTO `act_guochao_shop` VALUES (6, 3350, 0, '//img01.yohoboys.com/o_1cn3618p3vjf1g8n1ff31ala3kc8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3350&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3350\",\"shop_template_type\":\"1\",\"shop_name\":\"CarrotsbyAnwar\",\"is_red_shop\":\"1\"}}', 3, 0, 'Carrots by Anwar', '2018-09-10 14:20:25');
INSERT INTO `act_guochao_shop` VALUES (7, 25, 0, '//img01.yohoboys.com/o_1cn35qg8716q118iefp8h419nc8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=25&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"25\",\"shop_template_type\":\"1\",\"shop_name\":\"kissfunk\",\"is_red_shop\":\"1\"}}', 7, 0, 'kissfunk', '2018-09-10 14:21:11');
INSERT INTO `act_guochao_shop` VALUES (8, 1330, 0, '//img01.yohoboys.com/o_1cn35rff91bkptkt1lsm126rpvq8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1330&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1330\",\"shop_template_type\":\"1\",\"shop_name\":\"THETHING\",\"is_red_shop\":\"1\"}}', 6, 0, 'THETHING', '2018-09-10 14:21:40');
INSERT INTO `act_guochao_shop` VALUES (9, 1898, 0, '//img01.yohoboys.com/o_1cn362pj8k771eepr761qh91k5s8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1898&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1898\",\"shop_template_type\":\"1\",\"shop_name\":\"Diamond SUPPLY CO.\",\"is_red_shop\":\"1\"}}\r\n', 2, 0, 'Diamond SUPPLY CO.', '2018-09-10 14:22:05');
INSERT INTO `act_guochao_shop` VALUES (10, 1482, 0, '//img01.yohoboys.com/o_1cn365linika1mq416gj1in71j8r8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1482&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1482\",\"shop_template_type\":\"1\",\"shop_name\":\"MADNESS\",\"is_red_shop\":\"1\"}}', 26, 1, 'MADNESS', '2018-09-10 14:22:35');
INSERT INTO `act_guochao_shop` VALUES (11, 1306, 0, '//img01.yohoboys.com/o_1cn36497s1lv0l0n19181lus1t678.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1306&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1306\",\"shop_template_type\":\"1\",\"shop_name\":\"STORE by NIGO\",\"is_red_shop\":\"1\"}}', 1, 0, 'STORE by NIGO', '2018-09-10 14:23:05');
INSERT INTO `act_guochao_shop` VALUES (12, 992, 0, '//img01.yohoboys.com/o_1cn3671qg17p5ch2cqo1tscfon8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=992&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"992\",\"shop_template_type\":\"1\",\"shop_name\":\"ROARINGWILD\",\"is_red_shop\":\"1\"}}', 25, 1, 'ROARINGWILD', '2018-09-10 14:23:25');
INSERT INTO `act_guochao_shop` VALUES (13, 1474, 0, '//img01.yohoboys.com/o_1cn36e3df14i5snt14pm1v601sve8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1474&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1474\",\"shop_template_type\":\"1\",\"shop_name\":\"Dickies\",\"is_red_shop\":\"1\"}}', 20, 1, 'Dickies', '2018-09-10 14:23:45');
INSERT INTO `act_guochao_shop` VALUES (14, 1472, 0, '//img01.yohoboys.com/o_1cn36a7l9eak44r1j20g4c3qa8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1472&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1472\",\"shop_template_type\":\"1\",\"shop_name\":\"NOTHOMME\",\"is_red_shop\":\"1\"}}', 23, 1, 'NOTHOMME', '2018-09-10 14:24:06');
INSERT INTO `act_guochao_shop` VALUES (15, 1248, 0, '//img01.yohoboys.com/o_1cn36fnkhlbu1sn8cr21c954868.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1248&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1248\",\"shop_template_type\":\"1\",\"shop_name\":\"LEVI\'S\",\"is_red_shop\":\"1\"}}', 19, 1, 'LEVI\'S', '2018-09-10 14:24:30');
INSERT INTO `act_guochao_shop` VALUES (16, 97, 0, '//img01.yohoboys.com/o_1cn368ogn2sk6kcfmu1flnbt88.png', 'https://m.yohobuy.com/product/index/brand?shop_id=97&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"97\",\"shop_template_type\":\"1\",\"shop_name\":\"DUSTY\",\"is_red_shop\":\"1\"}}', 24, 1, 'DUSTY', '2018-09-10 14:25:15');
INSERT INTO `act_guochao_shop` VALUES (17, 3520, 0, '//img01.yohoboys.com/o_1cn36bljl2sh17rp1oi81b806t8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3520&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3520\",\"shop_template_type\":\"1\",\"shop_name\":\"MOSTWANTED LAB\",\"is_red_shop\":\"1\"}}', 22, 1, 'MOSTWANTED LAB', '2018-09-10 14:25:40');
INSERT INTO `act_guochao_shop` VALUES (18, 1298, 0, '//img01.yohoboys.com/o_1cn36vv2k145f175m1rsj9gd1jpl8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1298&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1298\",\"shop_template_type\":\"1\",\"shop_name\":\"Publish\",\"is_red_shop\":\"1\"}}', 9, 1, 'Publish', '2018-09-10 14:25:59');
INSERT INTO `act_guochao_shop` VALUES (19, 964, 0, '//img01.yohoboys.com/o_1cn36k6p7dkd10dihtj1hlm1lp28.png', 'https://m.yohobuy.com/product/index/brand?shop_id=964&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"964\",\"shop_template_type\":\"1\",\"shop_name\":\"ENSHADOWER隐蔽者\",\"is_red_shop\":\"1\"}}', 17, 1, 'ENSHAOWER隐蔽者', '2018-09-10 14:26:29');
INSERT INTO `act_guochao_shop` VALUES (20, 2642, 0, '//img01.yohoboys.com/o_1cn36h6u7nee137q1j2coed14h58.png', 'https://m.yohobuy.com/product/index/brand?shop_id=2642&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"2642\",\"shop_template_type\":\"1\",\"shop_name\":\"Timberland\",\"is_red_shop\":\"1\"}}', 18, 1, 'Timberland', '2018-09-10 14:26:51');
INSERT INTO `act_guochao_shop` VALUES (21, 990, 0, '//img01.yohoboys.com/o_1cn36oi1s1si8lei1cj1m3smfq8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=990&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"990\",\"shop_template_type\":\"1\",\"shop_name\":\"TMCAZ\",\"is_red_shop\":\"1\"}}', 14, 1, 'TMCAZ', '2018-09-10 14:27:15');
INSERT INTO `act_guochao_shop` VALUES (22, 1262, 0, '//img01.yohoboys.com/o_1cn36udo8233vp51fuqht1fcl8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1262&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1262\",\"shop_template_type\":\"1\",\"shop_name\":\"Herschel Supply\",\"is_red_shop\":\"1\"}}', 10, 1, 'Herschel Supply', '2018-09-10 14:27:56');
INSERT INTO `act_guochao_shop` VALUES (23, 1494, 0, '//img01.yohoboys.com/o_1cn36luci1pu7fel5mu1d51ts48.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1494&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1494\",\"shop_template_type\":\"1\",\"shop_name\":\"COMBACK\",\"is_red_shop\":\"1\"}}', 16, 1, 'COMBACK', '2018-09-10 14:28:21');
INSERT INTO `act_guochao_shop` VALUES (24, 369, 0, '//img01.yohoboys.com/o_1cn36t5011tujtsl69i9kkq0t8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=369&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"369\",\"shop_template_type\":\"1\",\"shop_name\":\"CHUMS\",\"is_red_shop\":\"1\"}}', 11, 1, 'CHUMS', '2018-09-10 14:28:42');
INSERT INTO `act_guochao_shop` VALUES (25, 292, 0, '//img01.yohoboys.com/o_1cn36d4uv1jpng9e1gea10bqdv48.png', 'https://m.yohobuy.com/product/index/brand?shop_id=292&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"292\",\"shop_template_type\":\"1\",\"shop_name\":\"Draconite\",\"is_red_shop\":\"1\"}}', 21, 1, 'Draconite', '2018-09-10 14:29:02');
INSERT INTO `act_guochao_shop` VALUES (26, 720, 0, '//img01.yohoboys.com/o_1cn36qh8g1hj8maq1m96kjds7c8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=720&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"720\",\"shop_template_type\":\"1\",\"shop_name\":\"BABAMA\",\"is_red_shop\":\"1\"}}', 14, 1, 'BABAMA', '2018-09-10 14:29:23');
INSERT INTO `act_guochao_shop` VALUES (27, 3146, 0, '//img01.yohoboys.com/o_1cn36nbdn11k9qtm2811qs71u558.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3146&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3146\",\"shop_template_type\":\"1\",\"shop_name\":\"11 by Boris Bidjan Saberi\",\"is_red_shop\":\"1\"}}', 15, 1, '11 by Boris Bidjan Saberi', '2018-09-10 14:31:22');
INSERT INTO `act_guochao_shop` VALUES (28, 1282, 0, '//img01.yohoboys.com/o_1cn373dusoj1nd01cs0a5bur88.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1282&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1282\",\"shop_template_type\":\"1\",\"shop_name\":\"SANKUANZ\",\"is_red_shop\":\"1\"}}', 7, 1, 'SANKUANZ', '2018-09-10 14:31:55');
INSERT INTO `act_guochao_shop` VALUES (29, 2312, 0, '//img01.yohoboys.com/o_1cn374gog1hlv12c213ia1aab1jss8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=2312&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"2312\",\"shop_template_type\":\"1\",\"shop_name\":\"UNDERCOVER\",\"is_red_shop\":\"1\"}}', 6, 1, 'UNDERCOVER', '2018-09-10 14:32:16');
INSERT INTO `act_guochao_shop` VALUES (30, 1878, 0, '//img01.yohoboys.com/o_1cn36rq8k1vbr1oddvlsgk21a758.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1878&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1878\",\"shop_template_type\":\"1\",\"shop_name\":\"umamiism\",\"is_red_shop\":\"1\"}}', 13, 1, 'umamiism', '2018-09-10 14:32:35');
INSERT INTO `act_guochao_shop` VALUES (31, 3210, 0, '//img01.yohoboys.com/o_1cn391n3b1f1p1qei1stka1f1h08.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3210&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3210\",\"shop_template_type\":\"1\",\"shop_name\":\"MM6 Maison Margiela\",\"is_red_shop\":\"1\"}}', 1, 1, 'Maison Margiela', '2018-09-10 14:32:59');
INSERT INTO `act_guochao_shop` VALUES (32, 3576, 0, '//img01.yohoboys.com/o_1cn371k241s321b3m1a991hb39gs8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3576&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3576\",\"shop_template_type\":\"1\",\"shop_name\":\"ATTEMPT\",\"is_red_shop\":\"1\"}}', 8, 1, 'ATTEMPT', '2018-09-10 14:33:26');
INSERT INTO `act_guochao_shop` VALUES (33, 1938, 0, '//img01.yohoboys.com/o_1cn37b56i1opn64g1chd6oo1u958.png', 'https://m.yohobuy.com/product/index/brand?shop_id=1938&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"1938\",\"shop_template_type\":\"1\",\"shop_name\":\"MISBHV\",\"is_red_shop\":\"1\"}}', 0, 1, 'MISBHV', '2018-09-10 14:33:48');
INSERT INTO `act_guochao_shop` VALUES (34, 468, 0, '//img01.yohoboys.com/o_1cn3765lv1bltdftqip17qd55i8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=468&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"468\",\"shop_template_type\":\"1\",\"shop_name\":\"FANTASTIC PLANET怪诞星球\",\"is_red_shop\":\"1\"}}', 5, 1, 'FANTASTIC PLANET怪诞星球', '2018-09-10 14:34:18');
INSERT INTO `act_guochao_shop` VALUES (35, 3012, 0, '//img01.yohoboys.com/o_1cn37890qn121g2tt9gn1inlo8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3012&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3012\",\"shop_template_type\":\"1\",\"shop_name\":\"christian dada\",\"is_red_shop\":\"1\"}}', 2, 1, 'christian dada', '2018-09-10 14:34:50');
INSERT INTO `act_guochao_shop` VALUES (36, 3196, 0, '//img01.yohoboys.com/o_1cn377bec1t07a9ann1bjl1kpl8.png', 'https://m.yohobuy.com/product/index/brand?shop_id=3196&openby:yohobuy={\"action\":\"go.shop\",\"params\":{\"shop_id\":\"3196\",\"shop_template_type\":\"1\",\"shop_name\":\"OZ FANTASY\",\"is_red_shop\":\"1\"}}', 3, 1, 'OZ FANTASY', '2018-09-10 14:35:20');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;
... ...