Storemsgread.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 Storemsgread extends BaseModel
  16. {
  17. /**
  18. * 新增店铺纤细阅读
  19. * @access public
  20. * @author csdeshang
  21. * @param array $data 参数内容
  22. * @return bool
  23. */
  24. public function addStoremsgread($data)
  25. {
  26. $data['storemsg_readtime'] = TIMESTAMP;
  27. return Db::name('storemsgread')->insert($data);
  28. }
  29. /**
  30. * 查看店铺消息阅读详细
  31. * @access public
  32. * @author csdeshang
  33. * @param type $condition 条件
  34. * @param type $field 字段
  35. * @return type
  36. */
  37. public function getStoremsgreadInfo($condition, $field = '*')
  38. {
  39. return Db::name('storemsgread')->field($field)->where($condition)->find();
  40. }
  41. /**
  42. * 店铺消息阅读列表
  43. * @access public
  44. * @author csdeshang
  45. * @param array $condition 条件
  46. * @param string $field 字段
  47. * @param string $order 排序
  48. * @return array
  49. */
  50. public function getStoremsgreadList($condition, $field = '*', $order = 'storemsg_readtime desc')
  51. {
  52. return Db::name('storemsgread')->field($field)->where($condition)->order($order)->select()->toArray();
  53. }
  54. /**
  55. * 删除店铺消息阅读记录
  56. * @access public
  57. * @author csdeshang
  58. * @param type $condition 条件
  59. * @return bool
  60. */
  61. public function delStoremsgread($condition)
  62. {
  63. Db::name('storemsgread')->where($condition)->delete();
  64. }
  65. }