OrderRefundAddress.php 1016 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\model\sharing;
  10. use app\store\model\ReturnAddress as ReturnAddressModel;
  11. use app\common\model\sharing\OrderRefundAddress as OrderRefundAddressModel;
  12. /**
  13. * 售后单退货地址模型
  14. * Class OrderRefundAddress
  15. * @package app\store\model\sharing
  16. */
  17. class OrderRefundAddress extends OrderRefundAddressModel
  18. {
  19. /**
  20. * 新增售后单退货地址记录
  21. * @param $order_refund_id
  22. * @param $address_id
  23. * @return false|int
  24. * @throws \think\exception\DbException
  25. */
  26. public function add($order_refund_id, $address_id)
  27. {
  28. $detail = ReturnAddressModel::detail($address_id);
  29. return $this->save([
  30. 'order_refund_id' => $order_refund_id,
  31. 'name' => $detail['name'],
  32. 'phone' => $detail['phone'],
  33. 'detail' => $detail['detail'],
  34. 'wxapp_id' => self::$wxapp_id
  35. ]);
  36. }
  37. }