|
@@ -157,7 +157,7 @@ module.exports = app => {
|
|
|
async getListByStatus(tenderId, status = 0, hadlimit = 1, sortBy = '', orderBy = '') {
|
|
|
let sql = '';
|
|
|
let sqlParam = '';
|
|
|
- if (this.ctx.tender.isTourist && status === 0) {
|
|
|
+ if ((this.ctx.tender.isTourist || this.ctx.session.sessionUser.is_admin) && status === 0) {
|
|
|
sql = 'SELECT a.*, p.name as account_name FROM ?? As a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE a.tid = ?';
|
|
|
sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId];
|
|
|
} else {
|
|
@@ -246,7 +246,7 @@ module.exports = app => {
|
|
|
* @return {void}
|
|
|
*/
|
|
|
async getCountByStatus(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 count(*) AS count FROM ?? WHERE tid = ? ORDER BY in_time DESC';
|
|
|
const sqlParam5 = [this.tableName, tenderId];
|
|
|
const result5 = await this.db.query(sql5, sqlParam5);
|
|
@@ -319,7 +319,7 @@ module.exports = app => {
|
|
|
* @return {void}
|
|
|
*/
|
|
|
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);
|