Cyd.php 727 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. *
  4. *User:Administrator
  5. *Date:2021/10/28
  6. */
  7. namespace app\api\controller\v1;
  8. use app\api\business\CydBus;
  9. use think\exception\ValidateException;
  10. class Cyd
  11. {
  12. public function getCydList()
  13. {
  14. $task_id = request()->param('task_id', '', 'int');
  15. try {
  16. validate(\app\api\validate\Sample::class)->scene('get_cyd_list')->check($task_id);
  17. } catch (ValidateException $exception) {
  18. return show(config('status.err_validate'),$exception->getError());
  19. }
  20. $result = (new CydBus())->getCydList($task_id);
  21. if ($result['total'] == 0) {
  22. return showError(config('status.none_cyd_info'));
  23. }
  24. return showSuccess($result);
  25. }
  26. }