store_msg_read.model.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * 店铺消息阅读模板模型
  4. *
  5. */
  6. defined('InShopNC') or exit('Access Invalid!');
  7. class store_msg_readModel extends Model{
  8. public function __construct() {
  9. parent::__construct('store_msg_read');
  10. }
  11. /**
  12. * 新增店铺纤细阅读
  13. * @param unknown $insert
  14. */
  15. public function addStoreMsgRead($insert) {
  16. $insert['read_time'] = time();
  17. return $this->insert($insert);
  18. }
  19. /**
  20. * 查看店铺消息阅读详细
  21. * @param unknown $condition
  22. * @param string $field
  23. */
  24. public function getStoreMsgReadInfo($condition, $field = '*') {
  25. return $this->field($field)->where($condition)->find();
  26. }
  27. /**
  28. * 店铺消息阅读列表
  29. * @param unknown $condition
  30. * @param string $field
  31. * @param string $order
  32. */
  33. public function getStoreMsgReadList($condition, $field = '*', $order = 'read_time desc') {
  34. return $this->field($field)->where($condition)->order($order)->select();
  35. }
  36. /**
  37. * 删除店铺消息阅读记录
  38. * @param unknown $condition
  39. */
  40. public function delStoreMsgRead($condition) {
  41. $this->where($condition)->delete();
  42. }
  43. }