AttendanceAddr.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class AttendanceAddr extends Base
  7. {
  8. // 列表
  9. public function list(){
  10. $page = input('page/d',1);
  11. $size = input('size/d',10);
  12. $title = input('title','','trim');
  13. $ret = model('AttendanceAddr')->lists($page,$size,$title,$this->orgId);
  14. HelpHander::success($ret);
  15. }
  16. // 新增
  17. public function save(){
  18. model('AttendanceAddr')->add();
  19. HelpHander::success([],'操作成功');
  20. }
  21. // 编辑
  22. public function update(){
  23. model('AttendanceAddr')->add();
  24. HelpHander::success([],'操作成功');
  25. }
  26. // 删除
  27. public function del(){
  28. $id = input('id/d',0);
  29. model('AttendanceAddr')->del($id);
  30. HelpHander::success([],'操作成功');
  31. }
  32. // 详情
  33. public function detail(){
  34. $id = input('id/d',0);
  35. $ret = model('AttendanceAddr')->info($id);
  36. HelpHander::success($ret);
  37. }
  38. public function modifyStatus(){
  39. $id = input('id/d',0);
  40. model('AttendanceAddr')->modifyStatus($id);
  41. HelpHander::success([],'操作成功');
  42. }
  43. public function availableAddrList(){
  44. $deviceSn = input('deviceSn','','trim');
  45. $lat = input('lat','','trim');
  46. $lng = input('lng','','trim');
  47. $ret = model('AttendanceAddr')->availableAddrList($deviceSn,$lat,$lng);
  48. HelpHander::success($ret);
  49. }
  50. public function all(){
  51. $ret = model('AttendanceAddr')->all($this->orgId);
  52. HelpHander::success($ret);
  53. }
  54. }