niucloud-admin/niucloud/core/dict/RechargeGift.php
全栈小学生 1d87b08b07 up
2025-01-03 17:59:22 +08:00

44 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace core\dict;
class RechargeGift extends BaseDict
{
/**
* 加载会员充值赠品组件
* @param array $data
* @return array|mixed
*/
public function load(array $data = [])
{
$addons = $this->getLocalAddons();
foreach ($addons as $v) {
$addon_change_type_file = $this->getAddonDictPath($v) . "recharge" . DIRECTORY_SEPARATOR . "package_gift.php";
if (is_file($addon_change_type_file)) {
$account_change_type_files[] = $addon_change_type_file;
}
}
$account_change_type_datas = $this->loadFiles($account_change_type_files);
$account_change_type_array = [];
foreach ($account_change_type_datas as $account_change_type_data) {
$account_change_type_array = empty($account_change_type_array) ? $account_change_type_data : array_merge2($account_change_type_array, $account_change_type_data);
}
foreach ($account_change_type_array as $key => &$value) {
$value[ 'key' ] = $key;
}
usort($account_change_type_array, function($list_one, $list_two) {
return $list_one[ 'sort' ] <=> $list_two[ 'sort' ];
});
return $account_change_type_array;
}
}