Beispiel #1
0
 def get(self):
     result = []
     len_sysonline = Member().getAll()[0]
     len_sysonline = dict(len_sysonline)
     for keys, values in len_sysonline.items():
         args = {}
         args['id'] = keys
         args['numbers'] = values
         result.append(args)
     results = {"success": True, "data": result}
     return results
Beispiel #2
0
 def get(self, id):
     sysonline = SysadminOnline().getdate(id)
     bank = SystemBankAccount().getdate(id)
     # len_sysonline = Member().getLen(id)[0][0][0]
     len_sysonline = Member().getLen(id)[0]
     len_sysonline = dict(len_sysonline)
     sysonline = dict(sysonline[0])
     bank = dict(bank[0])
     result_sysonline = []
     sysonline_args = {}
     result_bank = []
     bank_args = {}
     result_numbers = []
     numbers_args = {}
     for key, values in sysonline.items():
         result_one = {}
         result_one['id'] = key
         result_one['names'] = values
         result_sysonline.append(result_one)
     sysonline_args['sysonline'] = result_sysonline
     for key, values in bank.items():
         result_one = {}
         result_one['id'] = key
         result_one['names'] = values
         result_bank.append(result_one)
     bank_args['bank'] = result_bank
     keys = []
     result_one = {}
     for key, values in len_sysonline.items():
         keys.append(key)
         if 1 not in keys:
             result_one['numbers1'] = 0
             result_numbers.append(result_one)
         if 0 not in keys:
             result_one['numbers0'] = 0
             result_numbers.append(result_one)
         if 9 not in keys:
             result_one['numbers9'] = 0
             result_numbers.append(result_one)
         if 10 not in keys:
             result_one['numbers10'] = 0
             result_numbers.append(result_one)
         if 11 not in keys:
             result_one['numbers11'] = 0
             result_numbers.append(result_one)
         numbers = 'numbers{}'.format(key)
         result_one[numbers] = values
     result = {
         "success": True,
         "data": [sysonline_args, bank_args, result_one]
     }
     return result