Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
c6b59526
Commit
c6b59526
authored
Nov 01, 2019
by
方斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
z
parent
ede5c571
Pipeline
#15705
passed with stage
in 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
sys_guest.js
app/model/gjj/sys_guest.js
+38
-0
product.js
app/service/gjj/product.js
+8
-0
No files found.
app/model/gjj/sys_guest.js
0 → 100644
View file @
c6b59526
'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
;
};
app/service/gjj/product.js
View file @
c6b59526
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment