|
|
@@ -976,8 +976,8 @@ module.exports = app => {
|
|
|
const tableName = cpid ? this.ctx.service.contractPay.tableName : this.ctx.service.contract.tableName;
|
|
|
const joinSql = cpid ? 'ca.cpid' : 'ca.cid';
|
|
|
const cpidSql = cpid ? 'AND ca.`cpid` is not null' : 'AND ca.`cpid` is null';
|
|
|
- const sql = 'SELECT a.* FROM ?? as c LEFT JOIN ?? as ca ON c.`id` = ' + joinSql + ' WHERE ' + optionsSql + ' AND c.`contract_type` = ? AND c.`uid` = ? ' + cpidSql + ' AND ca.`audit_order` > 0 ORDER BY c.`create_time` DESC';
|
|
|
- const sqlParam = [tableName, this.tableName, options[this.setting.type], uid];
|
|
|
+ const sql = 'SELECT c.* FROM ?? as c LEFT JOIN ?? as ca ON c.`id` = ' + joinSql + ' WHERE ' + optionsSql + ' AND c.`contract_type` = ? AND c.`uid` = ? ' + cpidSql + ' AND ca.`audit_order` > 0 ORDER BY c.`create_time` DESC';
|
|
|
+ const sqlParam = [tableName, this.tableName, options.contract_type, uid];
|
|
|
return await this.db.queryOne(sql, sqlParam);
|
|
|
}
|
|
|
|