CydBus.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. *
  4. *User:Administrator
  5. *Date:2021/10/28
  6. */
  7. namespace app\api\business;
  8. use app\api\model\Cyd;
  9. class CydBus
  10. {
  11. public function getCydList($task_id)
  12. {
  13. $data = (new Cyd())->selectCydInfoByTaskID($task_id);
  14. $count = (new Cyd())->countCydInfoByTaskID($task_id);
  15. return ['rows'=>$data,'total'=>$count];
  16. }
  17. //修改抽样单状态,status=1已上报,0未上报
  18. public function upCydItem($sample_id)
  19. {
  20. $cyd_status = ['sample_status' => '1'];
  21. $result = (new Cyd())->updateCydDataBySampleID($sample_id, $cyd_status);
  22. return $result;
  23. }
  24. public function getCydItemBySampleId($sample_id)
  25. {
  26. $cyd_item = (new Cyd())->getCydDetailBySampleID($sample_id);
  27. return $cyd_item;
  28. }
  29. public function getCydByTaskIdAndUnitId($data,$page)
  30. {
  31. $where = [
  32. ['cyd.task_id','=',$data['task_id']],
  33. ['unit_id','=',$data['unit_id']]
  34. ];
  35. $jg_cyd_list = (new Cyd())->getCydListDetail($where,$page['pageNum'],$page['pageSize']);
  36. return $jg_cyd_list;
  37. }
  38. }