| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- /**
- * Created by PhpStorm.
- * User: wniu
- * Date: 2022/4/28
- * Time: 10:59 上午
- */
- namespace common\globals;
- class CurrencyGlobal extends BaseGlobal
- {
- /**
- * 获取币种
- * @param [type] $invokes
- * @param array $params
- * @return void
- */
- public function getCurrencyConfig($invokes, $params = [])
- {
- $currency_cond_list = [];
- foreach ($invokes as $invoke) {
- try {
- // 获取条件
- $currency_cond = $this->invoke($invoke['class'], $invoke['method'], $params);
- $is_success = $this->validateInvokeReturn($params['invoke_id'], $currency_cond);
- //
- if ($is_success) {
- $currency_cond_list = array_merge($currency_cond_list, $currency_cond);
- } else {
- throw new \Exception('结果数据格式校验未通过');
- }
- } catch (\Exception $e) {
- \Yii::error('全局调用(INVOKE_GET_WITHDRAW_COND)出错:' . $invoke['class'] . '->' . $invoke['method'] . 'msg:' . $e->getMessage());
- continue;
- }
- }
- return $currency_cond_list;
- }
- /**
- * 验证调用结果
- * @param [type] $return
- * @return boolean
- */
- protected function validateGetCurrencyConfig($return = null): bool
- {
- return true;
- }
- }
|