GetBankcardInfoGlobal.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /*
  3. * @Descripttion:
  4. * @version:
  5. * @Author: ewgof
  6. * @Date: 2022-04-07 14:16:38
  7. * @LastEditors: ewgof
  8. * @LastEditTime: 2022-04-16 15:25:01
  9. */
  10. namespace common\globals;
  11. use common\globals\BaseGlobal;
  12. use common\globals\GlobalInvoke;
  13. use common\models\common\AddonsInvoker;
  14. class GetBankcardInfoGlobal extends BaseGlobal
  15. {
  16. /**
  17. * 获取银行卡详情
  18. * @param [type] $invokes
  19. * @param array $params
  20. * @return array
  21. */
  22. public function getBankcardInfo($invokes, $params = [])
  23. {
  24. $list = [];
  25. foreach ($invokes as $invoke) {
  26. try {
  27. // 获取条件
  28. $res = $this->invoke($invoke['class'], $invoke['method'], $params);
  29. $is_success = $this->validateInvokeReturn($params['invoke_id'], $list);
  30. $list = array_merge($list, $res);
  31. // 全局调用获取提现条件
  32. if (!$is_success) {
  33. throw new \Exception('结果数据格式校验未通过');
  34. }
  35. } catch (\Exception $e) {
  36. \Yii::error('全局调用(INVOKE_GET_BANKCARD_LIST)出错:' . $invoke['class'] . '->' . $invoke['method'] . ', errmsg:' . $e->getMessage() . ',file: ' . $e->getFile() . ', line: ' . $e->getLine());
  37. continue;
  38. }
  39. }
  40. return $list;
  41. }
  42. /**
  43. * 验证调用结果
  44. * @param [type] $return
  45. * @return boolean
  46. */
  47. protected function validateGetBankCardInfo($return = null): bool
  48. {
  49. return true;
  50. }
  51. }