Explorar o código

管理员展示所有变更

ellisran hai 1 ano
pai
achega
6a937c3f55
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      app/service/change.js

+ 3 - 3
app/service/change.js

@@ -294,7 +294,7 @@ module.exports = app => {
             let sql = '';
             let sqlParam = '';
             const stateSql = state ? ' AND a.state = ' + state : '';
-            if (this.ctx.tender.isTourist && status === 0) {
+            if ((this.ctx.tender.isTourist || this.ctx.session.sessionUser.is_admin) && status === 0) {
                 sql = 'SELECT a.* FROM ?? As a WHERE a.tid = ?' + stateSql;
                 sqlParam = [this.tableName, tenderId];
             } else {
@@ -386,7 +386,7 @@ module.exports = app => {
          */
         async getCountByStatus(tenderId, status, state = 0) {
             const stateSql = state ? ' AND a.state = ' + state : '';
-            if (this.ctx.tender.isTourist && status === 0) {
+            if ((this.ctx.tender.isTourist || this.ctx.session.sessionUser.is_admin) && status === 0) {
                 const sql5 = 'SELECT count(*) AS count FROM ?? AS a WHERE a.tid = ?' + stateSql + ' ORDER BY a.in_time DESC';
                 const sqlParam5 = [this.tableName, tenderId];
                 const result5 = await this.db.query(sql5, sqlParam5);
@@ -464,7 +464,7 @@ module.exports = app => {
         }
 
         async getTp(tenderId, status) {
-            if (this.ctx.tender.isTourist && status === 0) {
+            if ((this.ctx.tender.isTourist || this.ctx.session.sessionUser.is_admin) && status === 0) {
                 const sql5 = 'SELECT SUM(cast (total_price as decimal(18,6))) AS total_price FROM ?? WHERE tid = ?';
                 const sqlParam5 = [this.tableName, tenderId];
                 const result5 = await this.db.query(sql5, sqlParam5);