|
|
@@ -8,7 +8,8 @@
|
|
|
* @version
|
|
|
*/
|
|
|
|
|
|
-const maxStashCount = 5;
|
|
|
+const maxStashCount = 3;
|
|
|
+const filterSelf = true;
|
|
|
|
|
|
module.exports = app => {
|
|
|
|
|
|
@@ -25,9 +26,13 @@ module.exports = app => {
|
|
|
this.tableName = 'spss_stash';
|
|
|
}
|
|
|
|
|
|
+ getCondition(spid, spss_type) {
|
|
|
+ return filterSelf ? { spid, spss_type, user_id: this.ctx.session.sessionUser.accountId} : { spid, spss_type };
|
|
|
+ }
|
|
|
+
|
|
|
async getSpssStashList(spid, spssType) {
|
|
|
const result = await this.getAllDataByCondition({
|
|
|
- where: { spid, spss_type: spssType },
|
|
|
+ where: this.getCondition(spid, spssType),
|
|
|
columns: [ 'id', 'user_id', 'user_name', 'create_time' ],
|
|
|
orders: [['create_time', 'desc']],
|
|
|
});
|
|
|
@@ -46,9 +51,9 @@ module.exports = app => {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
- async getLatestSpssStash(spid, type, user_id) {
|
|
|
+ async getLatestSpssStash(spid, type) {
|
|
|
const data = await this.getAllDataByCondition({
|
|
|
- where: { spid, spss_type: type, user_id },
|
|
|
+ where: this.getCondition(spid, type),
|
|
|
orders: [['create_time', 'desc']],
|
|
|
limit: 1,
|
|
|
offset: 0,
|