DepositOrderRepository.php 668 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Mead
  5. * Date: 2019/8/6
  6. * Time: 9:16 PM
  7. */
  8. namespace App\Repositories;
  9. use App\Models\DepositOrder;
  10. class DepositOrderRepository extends BaseRepository
  11. {
  12. protected $model;
  13. public function __construct(DepositOrder $model)
  14. {
  15. $this->model = $model;
  16. }
  17. /**
  18. * 获取用户的押金订单
  19. * @param $user_id
  20. * @return mixed
  21. * User: Mead
  22. */
  23. public function byUserIdGetUserDepositOrder($user_id)
  24. {
  25. return $this->model->where('user_id', $user_id)->where('pay_status', DepositOrder::PAY_STATUS_OK)->where('is_refund', DepositOrder::REFUND_NO)->first();
  26. }
  27. }