Alarm.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\index\model;
  3. use think\Model;
  4. /**
  5. * 工单报警模型
  6. */
  7. class Alarm extends Model
  8. {
  9. /**
  10. * 获取工单报警
  11. *
  12. * @access public
  13. * @param mixed $field 查询字段
  14. * @param mixed $where 条件
  15. * @return array 返回类型
  16. */
  17. public function findAlarm($field, $where)
  18. {
  19. $result = $this->field($field)->where($where)->find();
  20. return $result;
  21. }//end findAlarm()
  22. /**
  23. * 新增工单报警
  24. *
  25. * @access public
  26. * @param mixed $data 数据
  27. * @return array 返回类型
  28. */
  29. public function addAlarm($data)
  30. {
  31. $result = $this->insert($data);
  32. return $result;
  33. }//end addAlarm()
  34. /**
  35. * 修改工单报警
  36. *
  37. * @access public
  38. * @param mixed $where 条件
  39. * @param mixed $data 数据
  40. * @return array 返回类型
  41. */
  42. public function updateAlarm($where, $data)
  43. {
  44. $result = $this->where($where)->update($data);
  45. return $result;
  46. }//end updateAlarm()
  47. }