Commit c6b59526 authored by 方斌's avatar 方斌

z

parent ede5c571
Pipeline #15705 passed with stage
in 7 seconds
'use strict';
const moment = require('moment');
module.exports = app => {
const { STRING, INTEGER, DATE } = app.Sequelize;
const SysGuest = app.gjjModel.define('sys_guest', {
sid: {
type: INTEGER,
primaryKey: true,
autoIncrement: true
},
passport: {
type: STRING,
allowNull: false
},
place_cid: {
type: INTEGER,
allowNull: false
},
}, {
timestamps: false,
tableName: 'sys_guest',
});
SysGuest.one = async (data) => {
const attributes = data.attributes ? data.attributes : {};
const where = data.where ? data.where : {};
return await SysGuest.findOne({
attributes: attributes,
where: where,
});
}
return SysGuest;
};
......@@ -412,6 +412,14 @@ class ProductService extends Service {
let place_cid = 0;
if (userInfo !== null) {
place_cid = userInfo.place_cid;
} else {
const jianbing_guest_customer_id = ctx.cookies.get('jianbing_guest_customer_id', { signed: false });
filter = { where: { sid: jianbing_guest_customer_id } };
let userInfo = await ctx.gjjModel.SysGuest.one(filter);
if (userInfo !== null) {
place_cid = userInfo.place_cid;
}
}
//end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment