修改提现服务配置

This commit is contained in:
邹景立 2021-03-17 10:06:14 +08:00
parent f8ad4f71d5
commit 682a4bdeb4

View File

@ -11,7 +11,10 @@ use think\admin\Service;
*/ */
class UserTransferService extends Service class UserTransferService extends Service
{ {
/**
* 提现方式配置
* @var array
*/
protected $types = [ protected $types = [
'wechat_wallet' => '转账到我的微信零钱', 'wechat_wallet' => '转账到我的微信零钱',
'wechat_qrcode' => '线下微信收款码转账', 'wechat_qrcode' => '线下微信收款码转账',
@ -31,14 +34,17 @@ class UserTransferService extends Service
/** /**
* 获取提现配置 * 获取提现配置
* @return array * @param ?string $name
* @return array|string
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
*/ */
public function config(): array public function config(?string $name = null)
{ {
return sysdata('TransferRule'); static $data = [];
if (empty($data)) $data = sysdata('TransferRule');
return is_null($name) ? $data : ($data[$name] ?? '');
} }
} }