WithdrawLog.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace addons\YunfastPay\common\models;
  3. use addons\YunfastPay\common\enums\YunfastPayEnum;
  4. use common\models\user\UserWithdrawLog;
  5. /**
  6. * 主商城提现记录model
  7. * @package addons\YunfastPay\common\models
  8. */
  9. class WithdrawLog extends UserWithdrawLog
  10. {
  11. /**
  12. * 通过ids查询已审核提现记录
  13. *
  14. * @param integer $mall_id
  15. * @param array $ids
  16. * @param string|array $field
  17. * @return array
  18. */
  19. public static function getListByIdsAndAgree(int $mall_id, array $ids, $field = '*')
  20. {
  21. $condition = [
  22. 'id' => $ids,
  23. 'mall_id' => $mall_id,
  24. 'status' => static::STATUS_AGREE,
  25. 'type' => YunfastPayEnum::YUNFAST_PAY
  26. ];
  27. return static::find()
  28. ->where($condition)
  29. ->select($field)
  30. ->all();
  31. }
  32. /**
  33. * 通过ids修改记录为待打款
  34. *
  35. * @param integer $mall_id
  36. * @param array $ids
  37. * @return integer
  38. */
  39. public static function statusToWaitingByIds(int $mall_id, array $ids)
  40. {
  41. return static::updateAll(['status' => static::STATUS_WAIT], [
  42. 'id' => $ids,
  43. 'mall_id' => $mall_id,
  44. ]);
  45. }
  46. }