Commit 69c9fdd8 by sxy

feat: 存储商机

parent 8963aa90
......@@ -25,12 +25,9 @@ class FgbusinesschanceAPI extends APIBase {
case "create": //创建复购商机
opResult = await this.orderinfoSve.create(pobj, pobj.actionBody);
break;
case "getInfo": //获取商机
opResult = await this.orderinfoSve.getInfo(pobj, pobj.actionBody);
break;
case "updateStatus": //更新商机跟进状态 TODO
opResult = await this.orderinfoSve.findByBusinessId(pobj, pobj.actionBody);
break;
// case "getInfo": //获取商机
// opResult = await this.orderinfoSve.getInfo(pobj, pobj.actionBody);
// break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -17,26 +17,26 @@ class FgbusinesschancService extends ServiceBase {
// this.customQuery(sql);
// }
async create(req, actionBody) {
var sql = "INSERT INTO `fg_businesschance` (`companyId` ,`companyName`,`businessId`,`status`,`stateName`,`created_at`,`collectContent` ) VALUE (:companyId,:companyName,:businessId,:status,:stateName,:created_at,:collectContent)";
var sql = "INSERT INTO `fg_businesschance` (`companyId` ,`companyName`,`businessId`,`created_at` ) VALUE (:companyId,:companyName,:businessId,:created_at)";
await this.customInsert(sql, {
...actionBody,
"created_at": new Date()
"created_at": actionBody.createTime ? new Date(actionBody.createTime) : new Date()
});
return system.getResultSuccess();
};
async getInfo(req, actionBody) {
let sql = "select * from `fg_businesschance` where businessId=:businessId";
var result = system.getResultSuccess();
result.data = await this.customQuery(sql, {
businessId: actionBody.businessId
});
return result
};
// async getInfo(req, actionBody) {
// let sql = "select * from `fg_businesschance` where businessId=:businessId";
// var result = system.getResultSuccess();
// result.data = await this.customQuery(sql, {
// businessId: actionBody.businessId
// });
// return result
// };
async updateStatus(req, actionBody) {
var sql = "UPDATE `fg_businesschance` SET status=:status, stateName=:stateName where businessId=:businessId";
await this.customUpdate(sql, actionBody);
return system.getResultSuccess();
}
// async updateStatus(req, actionBody) {
// var sql = "UPDATE `fg_businesschance` SET status=:status, stateName=:stateName where businessId=:businessId";
// await this.customUpdate(sql, actionBody);
// return system.getResultSuccess();
// }
}
module.exports = FgbusinesschancService;
\ No newline at end of file
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