Example #1
0
 public function actionStatisticsSize()
 {
     $fileService = new FileService();
     $data = $fileService->adminStatisticsSize();
     return json_encode($data);
 }
Example #2
0
 public function actionPersonInfo()
 {
     $this->layout = 'person_info';
     $userId = $_SESSION['user']['user_id'];
     $disk = Disk::findOne(['user_id' => $userId]);
     $fileService = new FileService();
     $typeSize = $fileService->typeSize($userId);
     $logService = new LogService();
     $logs = $logService->getLoginLog();
     return $this->render('person_info', ['disk' => $disk, 'typeSize' => $typeSize, 'logs' => $logs]);
 }
Example #3
0
 public function actionGetCodeFile()
 {
     if (Yii::$app->request->isPost) {
         $code = $_POST['code'];
         $fileService = new FileService();
         $msg = $fileService->getFileByCode($code);
         switch ($msg) {
             case '1':
                 $data['code'] = '1';
                 $data['msg'] = '提取码不存在';
                 break;
             case '2':
                 $data['code'] = '2';
                 $data['msg'] = '文件已删除';
                 break;
             default:
                 $data['code'] = '0';
                 $data['file_id'] = $msg;
                 break;
         }
         return json_encode($data);
     }
 }