daddress.model.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * 发货地址
  4. *
  5. *
  6. *
  7. *
  8. */
  9. defined('InShopNC') or exit('Access Invalid!');
  10. class daddressModel extends Model {
  11. public function __construct() {
  12. parent::__construct('daddress');
  13. }
  14. /**
  15. * 新增
  16. * @param unknown $data
  17. * @return boolean, number
  18. */
  19. public function addAddress($data) {
  20. return $this->insert($data);
  21. }
  22. /**
  23. * 删除
  24. * @param unknown $condition
  25. */
  26. public function delAddress($condition) {
  27. return $this->where($condition)->delete();
  28. }
  29. public function editAddress($data, $condition) {
  30. return $this->where($condition)->update($data);
  31. }
  32. /**
  33. * 查询单条
  34. * @param unknown $condition
  35. * @param string $fields
  36. */
  37. public function getAddressInfo($condition, $fields = '*') {
  38. return $this->field($fields)->where($condition)->find();
  39. }
  40. /**
  41. * 查询多条
  42. * @param unknown $condition
  43. * @param string $pagesize
  44. * @param string $fields
  45. * @param string $order
  46. */
  47. public function getAddressList($condition, $fields = '*', $order = '', $limit = '') {
  48. return $this->field($fields)->where($condition)->order($order)->limit($limit)->select();
  49. }
  50. }