AppointmentLogServer.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\admin\server\medical;
  3. use app\admin\model\Appointment;
  4. use app\admin\model\AppointmentLog;
  5. use app\admin\model\MedicalCareOrder;
  6. use app\admin\model\MedicalCareOrderProduct;
  7. use app\admin\model\MedicalCarePostage;
  8. use app\admin\model\PackageOrderDetail;
  9. use app\admin\model\SystemAdmin;
  10. use app\admin\model\SystemMenu;
  11. use app\admin\model\SystemRole;
  12. class AppointmentLogServer
  13. {
  14. /**
  15. * Notes:预约服务记录
  16. * @param string $keywords
  17. * @param int $page
  18. * @param int $limit
  19. * @return array
  20. * User: QJF
  21. * Date: 2022/10/22
  22. */
  23. public static function getMentLogList(int $page, int $limit)
  24. {
  25. [$list, $count] = AppointmentLog::geMentLogList($page, $limit);
  26. return compact('list', 'page', 'limit', 'count');
  27. }
  28. /**
  29. * Notes:产品预约详情
  30. * @param int $package_id
  31. * @return int
  32. * User: QJF
  33. * Date: 2022/10/22
  34. */
  35. public static function infoMentLog($log_appointment_id)
  36. {
  37. AppointmentLog::affairBegin();
  38. try {
  39. $where = [];
  40. $where['log_id'] = $log_appointment_id;
  41. $result = AppointmentLog::with(['User','Appointment','Subject','Salesman','Visit','DocTor'])->where($where)->first();
  42. if (!empty($result)){
  43. AppointmentLog::affairCommit();
  44. return $result;
  45. }else{
  46. return false;
  47. }
  48. }catch (\Exception $exception){
  49. SystemRole::affairRollback();
  50. throw new \Exception($exception->getMessage(), 500);
  51. }
  52. }
  53. }