123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /**
- * Created by MyPC on 2019/11/5.
- */
- 'use strict';
- const hash= require('../class/hash');
- module.exports = (sequelize, DataTypes) => {
- const curing = sequelize.define('cloud_curing', {
- mobile: DataTypes.STRING,
- sso_id: DataTypes.STRING,
- compilation_id: DataTypes.STRING,
- curingCompany: DataTypes.STRING,
- sid: DataTypes.INTEGER,
- cid: DataTypes.INTEGER,
- status: DataTypes.INTEGER,
- client_id: DataTypes.INTEGER,
- addtime: DataTypes.STRING,
- updateTotal:DataTypes.INTEGER,
- upgradeDescribe: DataTypes.STRING,
- }, {});
- curing.associate = function(models) {
- // associations can be defined here
- };
- /*
- * 根据mobile获得已绑定养护云版用户
- * */
- curing.getCuringByMobile=async function(mobile){
- if(mobile==undefined){
- return [];
- }
- var condition={
- raw:true,
- where: {
- mobile: mobile
- }};
- var curingList = await this.findOne(condition);
- return curingList;
- };
- /*
- * 根据ssoid获得已绑定养护云版用户
- * */
- curing.getCuringBySsoid=async function(ssoid){
- if(!hash.isExistence(ssoid)){
- return [];
- }
- var condition={
- raw:true,
- where: {
- sso_id: ssoid
- }};
- var detail = await this.findOne(condition);
- if(!hash.isExistence(detail)){
- return [];
- }
- detail.id=hash.hashEncode(detail.id.toString());
- return detail;
- };
- /*
- * 根据id获得已绑定养护云版用户
- * */
- curing.getCuringById=async function(id){
- if(!hash.isExistence(id)){
- return [];
- }
- var condition={
- raw:true,
- where: {
- id: id
- }};
- var detail = await this.findOne(condition);
- return detail;
- };
- /*
- * 获得本地编办
- * */
- curing.getCuringCompilationList=async function(){
- return [];
- };
- return curing;
- };
|