appointmentlogic.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\app\logic;
  3. use app\index\model\appointmentmodel;
  4. /**
  5. * 登记记录表
  6. *
  7. * @author wj
  8. * @date 2022-07-22
  9. */
  10. class appointmentlogic extends baselogic
  11. {
  12. /**
  13. * 设置请求数据规则
  14. * 20220107
  15. * wj
  16. */
  17. protected function setrules()
  18. {
  19. $list = [
  20. 'getinfobyid' => [
  21. ['name' => 'id', 'title' => '申请id', 'require' => true, 'type' => 'numeric'],
  22. ],
  23. ];
  24. return $list;
  25. }
  26. /**
  27. * 获取用户当日申请最后一条数据
  28. *
  29. * @param [type] $arr
  30. * @return void
  31. * @author wj
  32. * @date 2022-07-22
  33. */
  34. public function getinfobyid($arr)
  35. {
  36. $result = $this->checkparam(__FUNCTION__, $arr);
  37. if (1 != $result['status']) {
  38. return $result;
  39. }
  40. $m_a = new appointmentmodel();
  41. $where = ['id' => $arr['id']];
  42. $field = ['name', 'sfzid', 'telno', 'signurl', 'oprdate', 'ispay', 'isuse', 'payorderno'];
  43. $info = $m_a->getInfo($where, $field);
  44. if (empty($info)) {
  45. return backarr(0, "无申请数据");
  46. }
  47. if (!$info['ispay']) {
  48. return backarr(0, "未支付");
  49. }
  50. if ($info['isuse']) {
  51. return backarr(0, "已使用");
  52. }
  53. return backarr(1, "查询成功", $info);
  54. }
  55. }