| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\base\Model;
- class RechargeModule extends Model
- {
- public $store_id;
- public function search_recharge()
- {
- $list = [
- 'status' => 0,
- 'pic_url' => \Yii::$app->request->hostInfo . \Yii::$app->request->baseUrl . '/statics/images/recharge/icon-balance-bg.png',
- 'ad_pic_url' => \Yii::$app->request->hostInfo . \Yii::$app->request->baseUrl . '/statics/images/recharge/icon-balance-ad.png',
- 'page_url' => '/pages/recharge/recharge',
- 'p_pic_url' => \Yii::$app->request->hostInfo . \Yii::$app->request->baseUrl . '/statics/images/recharge/icon-balance-p.png',
- 'help' => '',
- 'type' => 0,
- ];
- $name = [
- 'recharge_wallet_status',
- 'recharge_custom_status',
- 'recharge_pic_url',
- 'recharge_ad_pic_url',
- 'recharge_page_url',
- 'recharge_p_pic_url',
- 'recharge_help',
- ];
- $data = Option::get($name, $this->store_id, 'recharge');
- $data = array_column($data, null, 'name');
- $data = [
- 'status' => $data['recharge_wallet_status']['value'],
- 'pic_url' => $data['recharge_pic_url']['value'],
- 'ad_pic_url' => $data['recharge_ad_pic_url']['value'],
- 'page_url' => $data['recharge_page_url']['value'],
- 'p_pic_url' => $data['recharge_p_pic_url']['value'],
- 'help' => $data['recharge_help']['value'],
- 'type' => $data['recharge_custom_status']['value'],
- ];
- $new_list = [];
- if ($data) {
- foreach ($list as $index => $value) {
- if (isset($data[$index]) && $data[$index]) {
- $new_list[$index] = $data[$index];
- } else {
- $new_list[$index] = $value;
- }
- }
- } else {
- $new_list = $list;
- }
- return $new_list;
- }
- }
|