Commit b54ed38c by 蒋勇

d

parent 0b84ccc5
......@@ -8,7 +8,8 @@ const CtlBase = require("../../ctl.base");
var cacheBaseComp = null;
class PricecatCtl extends CtlBase {
constructor() {
super("common", CtlBase.getServiceName(PricecatCtl));
super("product", CtlBase.getServiceName(PricecatCtl));
this.pricestrategyService=system.getObject("service.product.pricestrategySve")
}
}
module.exports = PricecatCtl;
var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
class PricestrategyCtl extends CtlBase {
constructor() {
super("product", CtlBase.getServiceName(PricestrategyCtl));
}
}
module.exports = PricestrategyCtl;
const system=require("../../../system");
const Dao=require("../../dao.base");
class PricecatDao extends Dao{
constructor(){
super(Dao.getModelName(PricecatDao));
}
orderBy(qobj) {
//return {"key":"include","value":{model:this.db.models.app}};
if(!qobj.orderInfo || qobj.orderInfo.length==0){
return [["seq", "ASC"]];
}else{
return qobj.orderInfo;
}
}
}
module.exports=PricecatDao;
// var u=new UserDao();
// var roledao=system.getObject("db.roleDao");
// (async ()=>{
// var users=await u.model.findAll({where:{app_id:1}});
// var role=await roledao.model.findOne({where:{code:"guest"}});
// console.log(role);
// for(var i=0;i<users.length;i++){
// await users[i].setRoles([role]);
// console.log(i);
// }
//
// })();
......@@ -2,8 +2,16 @@ const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig=system.getSysConfig();
module.exports = (db, DataTypes) => {
//定价方式
//定价类型
return db.define("pricecat", {
seq:{
type: DataTypes.INTEGER,
allowNull: false,
},
code:{
type: DataTypes.STRING,
allowNull: false,
},
name: {
type: DataTypes.STRING,
allowNull: false,
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig=system.getSysConfig();
module.exports = (db, DataTypes) => {
//定价类型
return db.define("pricestrategy", {
codeunion:{
type: DataTypes.STRING,
allowNull: false,
},
nameunion: {
type: DataTypes.STRING,
allowNull: false,
},//和user的from相同,在注册user时,去创建
optionunion: {
type: DataTypes.STRING,
allowNull: false,
}//和user的from相同,在注册user时,去创建
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'p_pricestrategy',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
const fs = require("fs")
class PricestrategyService extends ServiceBase {
constructor() {
super("product", ServiceBase.getDaoName(PricestrategyService));
}
async buildPriceStrategy(){
}
}
module.exports = PricestrategyService;
// (async ()=>{
// let u=new AppService();
// // let x=await u.cregister("jiangong")
// // console.log(x)
// // let x=await u.cunregister("jiangong")
// // console.log(x)
// // let t=await u.cmakejwt()
// // console.log(t)
// //let ux=await u.cjsonregister(AppService.newRouteUrl("test-service2"),{name:"test-service2",hosts:["ttest1.com"]})
// //let ux=await u.cjsonregister(AppService.newServiceUrl(),{name:"test-service3",url:"http://zhichan.gongsibao.com"})
// //let ux=await u.cdel(AppService.routeUrl("test-service2"))
// //let ux=await u.cdel(AppService.serviceUrl("test-service2"))
// // let ux=await u.create({name:"test4-service",backend:"zhichan-service",domainName:"domain.com"})
// // console.log(ux);
// // let delrtn=await u.delete({id:2,name:"test4-service"})
// // console.log(delrtn);
// })()
\ 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