|
@@ -57,7 +57,7 @@ class RechargeChannel extends Controller
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
$params = request()->validate([
|
|
$params = request()->validate([
|
|
|
- 'data_type' => ['required', 'integer', 'in:1,2,3'],
|
|
|
|
|
|
|
+ 'data_type' => ['required', 'integer', 'in:1,2'],
|
|
|
'id' => ['nullable', 'integer', 'min:1'],
|
|
'id' => ['nullable', 'integer', 'min:1'],
|
|
|
]);
|
|
]);
|
|
|
return $this->success($service->options((int)$params['data_type'], isset($params['id']) ? (int)$params['id'] : null));
|
|
return $this->success($service->options((int)$params['data_type'], isset($params['id']) ? (int)$params['id'] : null));
|
|
@@ -73,10 +73,32 @@ class RechargeChannel extends Controller
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /** 充值/提现通道操作日志 */
|
|
|
|
|
+ public function logs(RechargeChannelConfigurationService $service)
|
|
|
|
|
+ {
|
|
|
|
|
+ try {
|
|
|
|
|
+ $params = request()->validate([
|
|
|
|
|
+ 'data_type' => ['required', 'integer', 'in:1,2'],
|
|
|
|
|
+ 'channel_id' => ['nullable', 'integer', 'min:1'],
|
|
|
|
|
+ 'operator_name' => ['nullable', 'string', 'max:100'],
|
|
|
|
|
+ 'action' => ['nullable', 'string', 'in:create,update,delete,save'],
|
|
|
|
|
+ 'start_time' => ['nullable', 'date'],
|
|
|
|
|
+ 'end_time' => ['nullable', 'date'],
|
|
|
|
|
+ 'page' => ['nullable', 'integer', 'min:1'],
|
|
|
|
|
+ 'limit' => ['nullable', 'integer', 'min:1', 'max:200'],
|
|
|
|
|
+ ]);
|
|
|
|
|
+ return $this->success($service->logs($params));
|
|
|
|
|
+ } catch (ValidationException $e) {
|
|
|
|
|
+ return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ return $this->error(HttpStatus::CUSTOM_ERROR, $e->getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//获取充值方式
|
|
//获取充值方式
|
|
|
public function getChannel()
|
|
public function getChannel()
|
|
|
{
|
|
{
|
|
|
- $data_type = request()->input('data_type', 1);
|
|
|
|
|
|
|
+ $data_type = (int)request()->input('data_type', 1) === 2 ? 2 : 1;
|
|
|
$channel = RechargeChannelModel::getChannel($data_type);
|
|
$channel = RechargeChannelModel::getChannel($data_type);
|
|
|
return $this->success(['total' => count($channel), 'data' => $channel]);
|
|
return $this->success(['total' => count($channel), 'data' => $channel]);
|
|
|
}
|
|
}
|
|
@@ -98,7 +120,6 @@ class RechargeChannel extends Controller
|
|
|
foreach($list as &$item) {
|
|
foreach($list as &$item) {
|
|
|
$item->rechargeTypes = $item['recharge_type'] ? RechargeChannelModel::getChannel(1, $item['recharge_type']) : [];
|
|
$item->rechargeTypes = $item['recharge_type'] ? RechargeChannelModel::getChannel(1, $item['recharge_type']) : [];
|
|
|
$item->withdrawTypes = $item['withdraw_type'] ? RechargeChannelModel::getChannel(2, $item['withdraw_type']) : [];
|
|
$item->withdrawTypes = $item['withdraw_type'] ? RechargeChannelModel::getChannel(2, $item['withdraw_type']) : [];
|
|
|
- $item->activityTypes = $item['activity_type'] ? RechargeChannelModel::getChannel(3, $item['activity_type']) : [];
|
|
|
|
|
}
|
|
}
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR,$e->getMessage());
|
|
return $this->error(HttpStatus::CUSTOM_ERROR,$e->getMessage());
|
|
@@ -117,7 +138,6 @@ class RechargeChannel extends Controller
|
|
|
'name' => ['required','string'],
|
|
'name' => ['required','string'],
|
|
|
'recharge_type' => ['present','array'],
|
|
'recharge_type' => ['present','array'],
|
|
|
'withdraw_type' => ['present','array'],
|
|
'withdraw_type' => ['present','array'],
|
|
|
- 'activity_type' => ['nullable','array'],
|
|
|
|
|
]);
|
|
]);
|
|
|
$removed = app(RechargeChannelConfigurationService::class)->saveGroup($params);
|
|
$removed = app(RechargeChannelConfigurationService::class)->saveGroup($params);
|
|
|
return $this->success([], $removed === [] ? '' : '保存成功,已清理失效的历史通道类型');
|
|
return $this->success([], $removed === [] ? '' : '保存成功,已清理失效的历史通道类型');
|
|
@@ -160,7 +180,7 @@ class RechargeChannel extends Controller
|
|
|
$params = request()->validate([
|
|
$params = request()->validate([
|
|
|
'page' => ['nullable', 'integer', 'min:1'],
|
|
'page' => ['nullable', 'integer', 'min:1'],
|
|
|
'limit' => ['nullable', 'integer', 'min:1'],
|
|
'limit' => ['nullable', 'integer', 'min:1'],
|
|
|
- 'data_type' => ['nullable', 'string'],
|
|
|
|
|
|
|
+ 'data_type' => ['nullable', 'integer', 'in:1,2'],
|
|
|
'type' => ['nullable', 'string'],
|
|
'type' => ['nullable', 'string'],
|
|
|
'from' => ['nullable', 'integer'],
|
|
'from' => ['nullable', 'integer'],
|
|
|
'key' => ['nullable', 'string'],
|
|
'key' => ['nullable', 'string'],
|
|
@@ -170,7 +190,8 @@ class RechargeChannel extends Controller
|
|
|
$page = request()->input('page', 1);
|
|
$page = request()->input('page', 1);
|
|
|
$limit = request()->input('limit', 15);
|
|
$limit = request()->input('limit', 15);
|
|
|
|
|
|
|
|
- $query = new RechargeChannelModel();
|
|
|
|
|
|
|
+ // 只管理充值(1)、提现(2)通道;原活动(3)配置已停用
|
|
|
|
|
+ $query = RechargeChannelModel::query()->whereIn('data_type', [1, 2]);
|
|
|
if (!empty($params['data_type'])) {
|
|
if (!empty($params['data_type'])) {
|
|
|
$query = $query->where('data_type', $params['data_type']);
|
|
$query = $query->where('data_type', $params['data_type']);
|
|
|
}
|
|
}
|
|
@@ -229,7 +250,7 @@ class RechargeChannel extends Controller
|
|
|
'payment_company' => ['nullable', Rule::in(PaymentProviderCatalog::codes())],
|
|
'payment_company' => ['nullable', Rule::in(PaymentProviderCatalog::codes())],
|
|
|
'key' => ['nullable','string','max:100'],
|
|
'key' => ['nullable','string','max:100'],
|
|
|
'name' => ['nullable','string','max:100'],
|
|
'name' => ['nullable','string','max:100'],
|
|
|
- 'data_type' => ['required','integer','in:1,2,3'],
|
|
|
|
|
|
|
+ 'data_type' => ['required','integer','in:1,2'],
|
|
|
'type' => ['required','string','max:100'],
|
|
'type' => ['required','string','max:100'],
|
|
|
'rate' => ['required','numeric','min:0'],
|
|
'rate' => ['required','numeric','min:0'],
|
|
|
'min' => ['exclude_if:type,zfbge','nullable','numeric','min:0'],
|
|
'min' => ['exclude_if:type,zfbge','nullable','numeric','min:0'],
|