multi-store/app/api/controller/user/UserRechargeController.php

47 lines
1.4 KiB
PHP

<?php
namespace app\api\controller\user;
use app\api\lists\user\UserFeedbackLists;
use app\api\logic\user\UserFeedbackLogic;
use app\admin\validate\user\UserFeedbackValidate;
use app\api\controller\BaseApiController;
use app\api\lists\user\UserRechargeLists;
use app\common\model\dict\DictData;
class UserRechargeController extends BaseApiController
{
/**
* @notes 获取用户充值
* @return \support\Response
* @author likeadmin
* @date 2024/05/13 16:56
*/
public function lists()
{
return $this->dataLists(new UserRechargeLists());
}
public function recharge_list()
{
$buy_bar = "元采购包";
$send_bar = "品牌礼品券";
$list = DictData::where('type_value', 'recharge')->select()
->each(function($item)use($buy_bar,$send_bar){
$item['money'] = $item['value'];
$item['money_string'] = $buy_bar;
$item['send_string'] = $send_bar;
if($item['name']=='level_one'){
$item['send'] = 249;
}elseif($item['name']=='level_two'){
$item['send'] = 560;
}elseif($item['name']=='level_three'){
$item['send'] = 1550;
}elseif($item['name']=='level_four'){
$item['send'] = 3500;
}
});
return $this->success('ok', $list?->toArray());
}
}