|
@@ -2,53 +2,50 @@
|
|
|
* Created by luququ on 2015/10/15.
|
|
|
*/
|
|
|
var seq;
|
|
|
-exports.delete = function(serverId){
|
|
|
- return seq.query('delete from users where serverId = :sid',
|
|
|
- {
|
|
|
- replacements:{sid:serverId},
|
|
|
- type:seq.QueryTypes.DELETE
|
|
|
- });
|
|
|
+exports.delete = function(serverId) {
|
|
|
+ return seq.query('delete from users where serverId = :sid', {
|
|
|
+ replacements: { sid: serverId },
|
|
|
+ type: seq.QueryTypes.DELETE
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
-exports.insert = function(users){
|
|
|
- return seq.query('insert users(loginName, displayName, password, watchWord, loginState, branchId, position, company, branch, duty, tel, mobile, version, intro, shortMobile, officeId, serverId, email, id, secret, roles, mainRole, userType, enableAccont, enableSendSms, enableMultiSendSms, addrBookSize, daySMS, sendedSMS, daySMSLimit) ' +
|
|
|
- 'values('+
|
|
|
- ':loginName,'+
|
|
|
- ':displayName,'+
|
|
|
- ':password,'+
|
|
|
- ':watchWord,'+
|
|
|
- ':loginState,'+
|
|
|
- ':branchId,'+
|
|
|
- ':position,'+
|
|
|
- ':company,'+
|
|
|
- ':branch,'+
|
|
|
- ':duty,'+
|
|
|
- ':tel,'+
|
|
|
- ':mobile,'+
|
|
|
- ':version,'+
|
|
|
- ':intro,'+
|
|
|
- ':shortMobile,'+
|
|
|
- ':officeId,'+
|
|
|
- ':serverId,'+
|
|
|
- ':email,'+
|
|
|
- ':id,'+
|
|
|
- ':secret,'+
|
|
|
- ':roles,'+
|
|
|
- ':mainRole,'+
|
|
|
- ':userType,'+
|
|
|
- ':enableAccont,'+
|
|
|
- ':enableSendSms,'+
|
|
|
- ':enableMultiSendSms,'+
|
|
|
- ':addrBookSize,'+
|
|
|
- ':daySMS,'+
|
|
|
- ':sendedSMS,'+
|
|
|
- ':daySMSLimit)',
|
|
|
- {
|
|
|
- replacements:users,
|
|
|
- type:seq.QueryTypes.INSERT
|
|
|
+exports.insert = function(users) {
|
|
|
+ return seq.query('insert users(loginName, displayName, password, watchWord, loginState, branchId, position, company, branch, duty, tel, mobile, version, intro, shortMobile, officeId, serverId, email, id, secret, roles, mainRole, userType, enableAccont, enableSendSms, enableMultiSendSms, addrBookSize, sendedSMS, daySMSLimit) ' +
|
|
|
+ 'values(' +
|
|
|
+ ':loginName,' +
|
|
|
+ ':displayName,' +
|
|
|
+ ':password,' +
|
|
|
+ ':watchWord,' +
|
|
|
+ ':loginState,' +
|
|
|
+ ':branchId,' +
|
|
|
+ ':position,' +
|
|
|
+ ':company,' +
|
|
|
+ ':branch,' +
|
|
|
+ ':duty,' +
|
|
|
+ ':tel,' +
|
|
|
+ ':mobile,' +
|
|
|
+ ':version,' +
|
|
|
+ ':intro,' +
|
|
|
+ ':shortMobile,' +
|
|
|
+ ':officeId,' +
|
|
|
+ ':serverId,' +
|
|
|
+ ':email,' +
|
|
|
+ ':id,' +
|
|
|
+ ':secret,' +
|
|
|
+ ':roles,' +
|
|
|
+ ':mainRole,' +
|
|
|
+ ':userType,' +
|
|
|
+ ':enableAccont,' +
|
|
|
+ ':enableSendSms,' +
|
|
|
+ ':enableMultiSendSms,' +
|
|
|
+ ':addrBookSize,' +
|
|
|
+ ':sendedSMS,' +
|
|
|
+ ':daySMSLimit)', {
|
|
|
+ replacements: users,
|
|
|
+ type: seq.QueryTypes.INSERT
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-exports.setSequelize = function(sequelize){
|
|
|
+exports.setSequelize = function(sequelize) {
|
|
|
seq = sequelize;
|
|
|
};
|