ClerkDetailGlobal.php 1.6 KB

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