store_sns_comment.model.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * 店铺动态评论
  4. *
  5. *
  6. *
  7. *
  8. */
  9. defined('InShopNC') or exit('Access Invalid!');
  10. class store_sns_commentModel extends Model {
  11. public function __construct(){
  12. parent::__construct('store_sns_comment');
  13. }
  14. /**
  15. * 店铺动态评论列表
  16. *
  17. * @param array $condition
  18. * @param string $field
  19. * @param string $order
  20. * @param int $limit
  21. * @param int $page
  22. * @return array
  23. */
  24. public function getStoreSnsCommentList($condition, $field = '*', $order = 'scomm_id desc', $limit = 0, $page = 0) {
  25. return $this->where($condition)->field($field)->order($order)->limit($limit)->page($page)->select();
  26. }
  27. /**
  28. * 店铺评论数量
  29. * @param array $condition
  30. * @return array
  31. */
  32. public function getStoreSnsCommentCount($condition) {
  33. return $this->where($condition)->count();
  34. }
  35. /**
  36. * 获取单条评论
  37. *
  38. * @param array $condition
  39. * @param string $field
  40. * @return array
  41. */
  42. public function getStoreSnsCommentInfo($condition, $field = '*') {
  43. return $this->where($condition)->field($field)->find();
  44. }
  45. /**
  46. * 保存店铺评论
  47. *
  48. * @param array $insert
  49. * @return boolean
  50. */
  51. public function saveStoreSnsComment($insert) {
  52. return $this->insert($insert);
  53. }
  54. public function editStoreSnsComment($update, $condition) {
  55. return $this->where($condition)->update($update);
  56. }
  57. /**
  58. * 删除店铺动态评论
  59. *
  60. * @param array $condition
  61. * @return boolean
  62. */
  63. public function delStoreSnsComment($condition) {
  64. return $this->where($condition)->delete();
  65. }
  66. }