DtalkRobot.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\store\model;
  3. use app\common\model\DtalkRobot as DtalkRobotModel;
  4. /**
  5. * 钉钉机器人
  6. *
  7. * @Author Mark
  8. * @DateTime 2024-08-09
  9. */
  10. class DtalkRobot extends DtalkRobotModel
  11. {
  12. /**
  13. * [getList]
  14. * 获取机器人列表
  15. *
  16. * @Author: Yeshihao
  17. * @DateTime: 2024/8/12 9:45
  18. * @return \think\Paginator
  19. * @throws \think\exception\DbException
  20. */
  21. public function getList()
  22. {
  23. $query = self::useGlobalScope(true);
  24. $query = $this->handlerSearch($query, request()->param());
  25. return $query->where('is_delete', '=', 0)
  26. ->order(['create_time' => 'desc'])
  27. ->paginate(15, false, ['query' => request()->request()]);
  28. }
  29. /**
  30. * [add]
  31. *
  32. * @Author: Yeshihao
  33. * @DateTime: 2024/8/12 9:53
  34. * @param $data
  35. * @return false|int
  36. */
  37. public function add($data)
  38. {
  39. $data['wxapp_id'] = self::$wxapp_id;
  40. return $this->allowField(true)->save($data);
  41. }
  42. /**
  43. * [edit]
  44. *
  45. * @Author: Yeshihao
  46. * @DateTime: 2024/8/12 9:54
  47. * @param $data
  48. * @return false|int
  49. */
  50. public function edit($data)
  51. {
  52. return $this->allowField(true)->save($data);
  53. }
  54. }