tubelogic.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\client\logic;
  3. use app\common\logic\baselogic;
  4. use app\common\model\tubemodel;
  5. /**
  6. * 登记记录表
  7. *
  8. * @author wj
  9. * @date 2022-07-22
  10. */
  11. class tubelogic extends baselogic
  12. {
  13. /**
  14. * 设置请求数据规则
  15. * 20220107
  16. * wj
  17. */
  18. protected function setrules()
  19. {
  20. $list = [
  21. 'gettodaydata' => [
  22. ['name' => 'page', 'title' => '当前页数', 'require' => false, 'type' => 'numeric', 'default' => 1],
  23. ['name' => 'size', 'title' => '每页条数', 'require' => false, 'type' => 'numeric', 'default' => 10],
  24. ['name' => 'date', 'title' => '日期', 'require' => false, 'type' => 'numeric', 'default' => 10],
  25. ],
  26. ];
  27. return $list;
  28. }
  29. /**
  30. * 根据日期获取未处理数据
  31. *
  32. * @param [type] $arr
  33. * @return void
  34. * @author wj
  35. * @date 2022-08-02
  36. */
  37. public function getdatabydate($arr)
  38. {
  39. $result = $this->checkparam(__FUNCTION__, $arr);
  40. if (1 != $result['status']) {
  41. return $result;
  42. }
  43. $data = $result['data'];
  44. $date = $data['date'];
  45. $page = $data['page'];
  46. $size = $data['size'];
  47. $m_t = new tubemodel();
  48. $typelist = $m_t->gettesttypelist();
  49. $where = ['create_date' => ['like', '%' . $date . '%'], 'detection_result' => 0];
  50. $size = 10;
  51. $count = $m_t->getList($where, 'count');
  52. if (empty($count)) {
  53. return backarr(0, "无数据");
  54. }
  55. $list = $m_t->getList($where, '*', $page, $size, 'id asc')->toArray();
  56. if (empty($list)) {
  57. return backarr(0, "无数据");
  58. }
  59. return backarr(1, "查询成功", $list);
  60. }
  61. }