[ # 'commission' => [ # 'is_enable' => 1, # 'commission_type' => 1, # 'is_percent_team' => 1, # 'detail' => [ # '1' => [ # 'id' => 1, # 'agent_team_prize' => 1, # 'agent_over_prize' => 1, # ], # '2' => [ # 'id' => 2, # 'agent_team_prize' => 1, # 'agent_over_prize' => 1, # ], # ], # ], # 'score' => [ # 'is_enable' => 0, # 'item_type' => 0, # 'is_percent_team' => 0, # 'detail' => [ # '3' => [ # 'id' => 3, # 'agent_team_prize' => 1, # 'agent_over_prize' => 1, # ], # ], # ], # ], # 'Distribution' => [ # 'commission' => [ # 'is_enable' => 1, # 'commission_type' => 1, # 'is_percent_team' => 1, # 'detail' => [ # '1' => [ # 'id' => 1, # 'agent_team_prize' => 1, # 'agent_over_prize' => 1, # ], # ] # ], # ] #]; ########################################################################################################## /** * 获取模式列表内容 * @param [type] $invokes * @param array $params * @return array */ public function getGoodsModel($invokes, $params = []) { $return = []; foreach ($invokes as $invoke) { try { if (!MallAddons::isInstall($params['mall_id'], $invoke['addons_name'])) continue; if (class_exists($invoke['class']) && method_exists($invoke['class'], 'getDetail') == false) { unset($params['with']); } else { $params['with'] = 'detail'; } $data = $this->invoke($invoke['class'], $invoke['method'], $params); $is_success = $this->validateInvokeReturn($params['invoke_id'], $data); if ($is_success) { if(empty($data)){ continue; } } else { throw new \Exception('结果数据格式校验未通过'); } $return[$invoke['addons_name']] = $data; } catch (\Exception $e) { \Yii::error('全局调用(INVOKE_GET_WITHDRAW_COND)出错:' . $invoke['class'] . '->' . $invoke['method'] . 'msg:' . $e->getMessage()); continue; } } return $return; } /** * 验证调用结果 * @param [type] $return * @return boolean */ protected function validateGetGoodsModel($return = null): bool { return true; } }