DeleteBankcardGlobal.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 DeleteBankcardGlobal extends BaseGlobal
  15. {
  16. /**
  17. * 获取银行卡详情
  18. * @param [type] $invokes
  19. * @param array $params
  20. * @return array
  21. */
  22. public function del($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. if(!empty($res['code']))throw new \Exception($res['msg']);
  31. $list = array_merge($list, $res);
  32. // 全局调用获取提现条件
  33. if (!$is_success) {
  34. throw new \Exception('结果数据格式校验未通过');
  35. }
  36. } catch (\Exception $e) {
  37. \Yii::error('全局调用(INVOKE_GET_BANKCARD_LIST)出错:' . $invoke['class'] . '->' . $invoke['method'] . ', errmsg:' . $e->getMessage() . ',file: ' . $e->getFile() . ', line: ' . $e->getLine());
  38. throw new \Exception($e->getMessage());
  39. continue;
  40. }
  41. }
  42. return $list;
  43. }
  44. /**
  45. * 验证调用结果
  46. * @param [type] $return
  47. * @return boolean
  48. */
  49. protected function validateDel($return = null): bool
  50. {
  51. return true;
  52. }
  53. }