ReturnAddress.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace app\supplier\model\settings;
  3. use app\common\model\settings\ReturnAddress as ReturnAddressModel;
  4. /**
  5. * 退货地址模型
  6. */
  7. class ReturnAddress extends ReturnAddressModel
  8. {
  9. /**
  10. * 获取列表
  11. */
  12. public function getList($limit = 10,$shop_supplier_id)
  13. {
  14. return $this->order(['sort' => 'asc'])
  15. ->where('shop_supplier_id','=',$shop_supplier_id)
  16. ->where('is_delete', '=', 0)
  17. ->paginate($limit);
  18. }
  19. /**
  20. * 获取全部收货地址
  21. */
  22. public function getAll($shop_supplier_id)
  23. {
  24. return $this->where('shop_supplier_id', '=', $shop_supplier_id)
  25. ->where('is_delete', '=', 0)
  26. ->order(['sort' => 'asc'])
  27. ->select();
  28. }
  29. /**
  30. * 添加新记录
  31. */
  32. public function add($data)
  33. {
  34. $data['app_id'] = self::$app_id;
  35. return $this->save($data);
  36. }
  37. /**
  38. * 编辑记录
  39. */
  40. public function edit($data)
  41. {
  42. return $this->save($data);
  43. }
  44. /**
  45. * 删除记录
  46. */
  47. public function remove()
  48. {
  49. return $this->save(['is_delete' => 1]);
  50. }
  51. }