Storemsgread.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Storemsgread extends BaseModel
  15. {
  16. /**
  17. * 新增店铺纤细阅读
  18. * @access public
  19. * @author csdeshang
  20. * @param array $data 参数内容
  21. * @return bool
  22. */
  23. public function addStoremsgread($data)
  24. {
  25. $data['storemsg_readtime'] = TIMESTAMP;
  26. return Db::name('storemsgread')->insert($data);
  27. }
  28. /**
  29. * 查看店铺消息阅读详细
  30. * @access public
  31. * @author csdeshang
  32. * @param type $condition 条件
  33. * @param type $field 字段
  34. * @return type
  35. */
  36. public function getStoremsgreadInfo($condition, $field = '*')
  37. {
  38. return Db::name('storemsgread')->field($field)->where($condition)->find();
  39. }
  40. /**
  41. * 店铺消息阅读列表
  42. * @access public
  43. * @author csdeshang
  44. * @param array $condition 条件
  45. * @param string $field 字段
  46. * @param string $order 排序
  47. * @return array
  48. */
  49. public function getStoremsgreadList($condition, $field = '*', $order = 'storemsg_readtime desc')
  50. {
  51. return Db::name('storemsgread')->field($field)->where($condition)->order($order)->select()->toArray();
  52. }
  53. /**
  54. * 删除店铺消息阅读记录
  55. * @access public
  56. * @author csdeshang
  57. * @param type $condition 条件
  58. * @return bool
  59. */
  60. public function delStoremsgread($condition)
  61. {
  62. Db::name('storemsgread')->where($condition)->delete();
  63. }
  64. }