Adminlog.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 数据层模型
  14. */
  15. class Adminlog extends BaseModel {
  16. public $page_info;
  17. /**
  18. * 获取日志记录列表
  19. * @author csdeshang
  20. * @param type $condition 查询条件
  21. * @param type $pagesize 分页信息
  22. * @param type $order 排序
  23. * @return type
  24. */
  25. public function getAdminlogList($condition, $pagesize = '', $order) {
  26. if ($pagesize) {
  27. $result = Db::name('adminlog')->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  28. $this->page_info = $result;
  29. return $result->items();
  30. } else {
  31. return Db::name('adminlog')->where($condition)->order($order)->select()->toArray();
  32. }
  33. }
  34. /**
  35. * 删除日志记录
  36. * @author csdeshang
  37. * @param type $condition 删除条件
  38. * @return type
  39. */
  40. public function delAdminlog($condition) {
  41. return Db::name('adminlog')->where($condition)->delete();
  42. }
  43. /**
  44. * 获取日志条数
  45. * @author csdeshang
  46. * @param type $condition 查询条件
  47. * @return type
  48. */
  49. public function getAdminlogCount($condition) {
  50. return Db::name('adminlog')->where($condition)->count();
  51. }
  52. /**
  53. * 增加日子
  54. * @author csdeshang
  55. * @param type $data
  56. * @return type
  57. */
  58. public function addAdminlog($data) {
  59. return Db::name('adminlog')->insertGetId($data);
  60. }
  61. }