| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace services\common;
- use common\components\Service;
- use common\models\common\Addons;
- use Exception;
- use Yii;
- class GlobalFunctionService extends Service
- {
- //订单检查
- public static function orderCheck($key,$params)
- {
- $data = Yii::$app->params;
- if(isset($params['order_type'])){
- $list = $data['common_function'][$key];
- if(isset($list)){
- $arr = [];
- foreach ($list as $val){
- $arr[$val['addons_name']] = $val;
- }
- if(isset($params['order_type'])&&isset($arr[$params['order_type']])){
- if(Addons::isInstall($params['order_type'])){
- $item = $arr[$params['order_type']];
- $class = $item['class'];
- $method = $item['method'];
- $res = $class::$method($params);
- if ($res == false){
- throw new Exception($class::getStaticError());
- }
- }
- }
- }
- }
- }
- }
|