AttendanceRecord.php 941 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. class AttendanceRecord extends Base
  6. {
  7. //手机打卡
  8. public function save(){
  9. $data = [
  10. 'lat' => input('lat','','trim'),
  11. 'lng' => input('lng','','trim'),
  12. 'address' => input('address','','trim'),
  13. 'device_sn' => input('deviceSn','','trim'),
  14. 'signtime' => date('Y-m-d H:i:s'),
  15. 'user_id' => input('userId/d',0),
  16. 'org_id' => input('orgId/d',0),
  17. 'remark' => input('remark','','trim'),
  18. ];
  19. model('AttendanceRecord')->sjsign($data);
  20. HelpHander::success([],'操作成功');
  21. }
  22. // 绑定设备
  23. public function bundleDevice(){
  24. $deviceSn = input('deviceSn','','trim');
  25. model('AttendanceRecord')->bundleDevice($this->userId,$deviceSn);
  26. HelpHander::success([],'操作成功');
  27. }
  28. }