Cyd.php 982 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. //监管端获取抽样单列表
  13. public function getCydList()
  14. {
  15. $task_id = request()->param('task_id', '', 'int');
  16. // try {
  17. // validate(\app\api\validate\Sample::class)->scene('get_cyd_list')->check($task_id);
  18. // } catch (ValidateException $exception) {
  19. // return show(config('status.err_validate'),$exception->getError());
  20. // }
  21. $result = (new CydBus())->getCydList($task_id);
  22. if ($result['total'] == 0) {
  23. return showError(config('status.none_cyd_info'));
  24. }
  25. return showSuccess($result);
  26. }
  27. public function updateCydStatus()
  28. {
  29. $cyd_id = request()->param('cyd_id', '', 'int');
  30. $result = (new CydBus())->updateCydStatus($cyd_id);
  31. return showSuccess($result);
  32. }
  33. }