arrival_notice.model.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * 商品到货通知模型
  4. *
  5. *
  6. *
  7. *
  8. */
  9. defined('InShopNC') or exit('Access Invalid!');
  10. class arrival_noticeModel extends Model{
  11. public function __construct() {
  12. parent::__construct('arrival_notice');
  13. }
  14. /**
  15. * 通知列表
  16. *
  17. *
  18. * @param unknown $condition
  19. * @param string $field
  20. * @param number $limit
  21. * @param string $order
  22. */
  23. public function getArrivalNoticeList($condition = array(), $field = '*', $limit = '', $order = 'an_id desc') {
  24. return $this->where($condition)->field($field)->limit($limit)->order($order)->select();
  25. }
  26. /**
  27. * 单条通知
  28. *
  29. * @param unknown $condition
  30. * @param string $field
  31. */
  32. public function getArrivalNoticeInfo($condition, $field = '*') {
  33. return $this->where($condition)->field($field)->find();
  34. }
  35. /**
  36. * 通知数量
  37. *
  38. * @param array $condition
  39. * @param string $field
  40. * @param string $order
  41. * @return array
  42. */
  43. public function getArrivalNoticeCount($condition) {
  44. return $this->where($condition)->count();
  45. }
  46. /**
  47. * 添加通知
  48. * @param array $insert
  49. * @return int
  50. */
  51. public function addArrivalNotice($insert) {
  52. $insert['an_addtime'] = time();
  53. return $this->insert($insert);
  54. }
  55. /**
  56. * 删除通知
  57. *
  58. * @param unknown $condition
  59. */
  60. public function delArrivalNotice($condition) {
  61. return $this->where($condition)->delete();
  62. }
  63. }