|
@@ -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);
|