123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- /**
- * Created by MyPC on 2019/11/5.
- */
- 'use strict';
- const hash= require('../class/hash');
- const Sequelize = require('sequelize');
- const Op = Sequelize.Op;
- 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
- };
-
- curing.getCuringInMobile=async function(mobile,compilation_id){
-
- if(!hash.isExistence(mobile)){
- return [];
- }
-
-
- var option={
- where: {
- mobile: {
- [Op.or]: [mobile]
- }
- },
- raw:true,
- };
- if(hash.isExistence(compilation_id)){
- option.where={compilation_id: compilation_id};
- }
-
- var curingList = await this.findAll(option);
- return curingList;
- };
-
- /*
- * ����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;
- };
|