Commit 1b99b754 by 王昆

gsb

parent dfe47114
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
class ObusinessmenDao extends Dao { class ObusinessmenDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(ObusinessmenDao)); super(Dao.getModelName(ObusinessmenDao));
} }
async countByCondition(params) {
let sql = [];
sql.push("SELECT");
sql.push("COUNT(1) AS num");
sql.push("FROM `o_businessmen` t1");
sql.push("WHERE 1 = 1");
}
async listByCondition(params) {
sql.push("SELECT");
sql.push("t1.*");
sql.push("FROM `o_businessmen` t1");
sql.push("WHERE 1 = 1");
this.setCondition(sql, params);
}
setCondition(sql, params) {
if(params.order_id) {
sql.push("AND t1.order_id = :order_id");
}
if(params.name) {
params.name_like = "%" + params.name + "%";
sql.push("AND t1.name = :name_like");
}
if(params.bd_id) {
sql.push("AND t1.bd_id = :bd_id");
}
if(params.bd_path) {
params.bd_path_like = "%" + params.bd_path + "%";
sql.push("AND t1.bd_path = :bd_path_like");
}
if(params.order_id) {
sql.push("AND t1.order_id = :order_id");
}
if(params.legal_name) {
sql.push("AND t1.legal_name = :legal_name");
}
if(params.legal_mobile) {
sql.push("AND t1.legal_mobile = :legal_mobile");
}
if(params.legal_idcard) {
sql.push("AND t1.legal_idcard = :legal_idcard");
}
if(params.credit_code) {
sql.push("AND t1.credit_code = :credit_code");
}
}
} }
module.exports = ObusinessmenDao; module.exports = ObusinessmenDao;
\ No newline at end of file
...@@ -7,7 +7,6 @@ module.exports = function (db, DataTypes) { ...@@ -7,7 +7,6 @@ module.exports = function (db, DataTypes) {
order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单id' }, order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单id' },
merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, comment:'商户id 为了司机宝' }, merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, comment:'商户id 为了司机宝' },
channel_order_no: { type: DataTypes.STRING, field: 'channel_order_no', allowNull: true, defaultValue:'', comment:'渠道订单号 为了司机宝'}, channel_order_no: { type: DataTypes.STRING, field: 'channel_order_no', allowNull: true, defaultValue:'', comment:'渠道订单号 为了司机宝'},
status: {type: DataTypes.STRING, field: 'status', allowNull: true,defaultValue:'2000', comment:'业务状态: 2000办理中, 2010待签约, 2020已完成' },
legal_name: { type: DataTypes.STRING, field: 'legal_name', allowNull: false,defaultValue:'', comment:'法人姓名'}, legal_name: { type: DataTypes.STRING, field: 'legal_name', allowNull: false,defaultValue:'', comment:'法人姓名'},
legal_mobile: {type: DataTypes.STRING, field: 'legal_mobile', allowNull: true,defaultValue:'', comment:'法人电话'}, legal_mobile: {type: DataTypes.STRING, field: 'legal_mobile', allowNull: true,defaultValue:'', comment:'法人电话'},
legal_idcard: { type: DataTypes.STRING, field: 'legal_idcard', allowNull: true, defaultValue:'',comment:'法人身份证号'}, legal_idcard: { type: DataTypes.STRING, field: 'legal_idcard', allowNull: true, defaultValue:'',comment:'法人身份证号'},
......
...@@ -110,6 +110,13 @@ class ObusinessmenService extends ServiceBase { ...@@ -110,6 +110,13 @@ class ObusinessmenService extends ServiceBase {
let bd_id = this.trim(params.bd_id); let bd_id = this.trim(params.bd_id);
let bd_path = this.trim(params.bd_path); let bd_path = this.trim(params.bd_path);
let legal_name = this.trim(params.legal_name);
let legal_mobile = this.trim(params.legal_mobile);
let legal_idcard = this.trim(params.legal_idcard);
let credit_code = this.trim(params.credit_code);
var where = {}; var where = {};
var orderby = [ var orderby = [
......
...@@ -582,6 +582,8 @@ class OorderstatusService extends ServiceBase { ...@@ -582,6 +582,8 @@ class OorderstatusService extends ServiceBase {
if (!params.business_gov_file) { if (!params.business_gov_file) {
return system.getResult(null, `参数错误 工商官方文件不能为空`); return system.getResult(null, `参数错误 工商官方文件不能为空`);
} }
let _order = params._order;
let _obusinessmenProperty = {}; let _obusinessmenProperty = {};
_obusinessmenProperty.name = this.trim(params.name); _obusinessmenProperty.name = this.trim(params.name);
_obusinessmenProperty.credit_code = this.trim(params.credit_code); _obusinessmenProperty.credit_code = this.trim(params.credit_code);
...@@ -590,8 +592,9 @@ class OorderstatusService extends ServiceBase { ...@@ -590,8 +592,9 @@ class OorderstatusService extends ServiceBase {
_obusinessmenProperty.reg_date = this.trim(params.reg_date); _obusinessmenProperty.reg_date = this.trim(params.reg_date);
_obusinessmenProperty.business_img = this.trim(params.business_img); _obusinessmenProperty.business_img = this.trim(params.business_img);
_obusinessmenProperty.business_gov_file = this.trim(params.business_gov_file); _obusinessmenProperty.business_gov_file = this.trim(params.business_gov_file);
_obusinessmenProperty.bd_id = this.trim(params.bd_id);
_obusinessmenProperty.bd_path = this.trim(params.bd_path);
let _order = params._order;
let orderProperty = {}; let orderProperty = {};
orderProperty.id = _order.id; orderProperty.id = _order.id;
orderProperty.status = this.trim(params.status); orderProperty.status = this.trim(params.status);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment