Exemplo n.º 1
0
 public function card()
 {
     $type = \Hnust\input('type');
     $startDate = \Hnust\input('startDate', null);
     $endDate = \Hnust\input('endDate', null);
     $card = new \Hnust\Analyse\Card($this->sid, $this->passwd);
     if ('bill' === $type) {
         $this->info = $card->getInfo();
         $this->data = $card->getBill($this->info['cardId'], $startDate, $endDate);
         $student = new \Hnust\Analyse\Student();
         if ($info = $student->info($this->sid)) {
             $this->data['assess'] = $info['assess'];
         } else {
             $this->data['assess'] = '适中';
         }
     } elseif (in_array($type, array('loss', 'reloss'))) {
         $loss = 'loss' === $type;
         $this->msg = $card->doLoss($loss);
         $this->info = $card->getInfo();
     } else {
         $this->info = $card->getInfo();
         $this->data = $card->getRecord($this->info['cardId'], $startDate, $endDate);
     }
     $this->info['sid'] = $this->sid;
 }