|
@@ -11,6 +11,13 @@ use App\Constants\HttpStatus;
|
|
|
class RechargeChannel extends Controller
|
|
class RechargeChannel extends Controller
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+ //获取充值方式
|
|
|
|
|
+ public function getChannel()
|
|
|
|
|
+ {
|
|
|
|
|
+ $channel = RechargeChannelModel::where('status', 1)->select(['type','name'])->get()->toArray();
|
|
|
|
|
+ return $this->success(['total' => count($channel), 'data' => $channel]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 充值通道组合列表
|
|
* 充值通道组合列表
|
|
|
*/
|
|
*/
|
|
@@ -26,7 +33,7 @@ class RechargeChannel extends Controller
|
|
|
->forPage($page, $limit)
|
|
->forPage($page, $limit)
|
|
|
->get();
|
|
->get();
|
|
|
foreach($list as &$item) {
|
|
foreach($list as &$item) {
|
|
|
- $item->rechargeChannel = RechargeChannelModel::whereIn('id', $item['channel_ids'])->get();
|
|
|
|
|
|
|
+ $item->rechargeChannel = RechargeChannelModel::whereIn('type', $item['type'])->get();
|
|
|
}
|
|
}
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR,$e->getMessage());
|
|
return $this->error(HttpStatus::CUSTOM_ERROR,$e->getMessage());
|
|
@@ -43,10 +50,10 @@ class RechargeChannel extends Controller
|
|
|
$params = request()->validate([
|
|
$params = request()->validate([
|
|
|
'id' => ['nullable','integer'],
|
|
'id' => ['nullable','integer'],
|
|
|
'name' => ['required','string'],
|
|
'name' => ['required','string'],
|
|
|
- 'channel_ids' => ['required','array'],
|
|
|
|
|
|
|
+ 'type' => ['required','string'],
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- $params['channel_ids'] = implode(',', $params['channel_ids']);
|
|
|
|
|
|
|
+ $params['type'] = implode(',', $params['type']);
|
|
|
if (empty($params['id'])) {
|
|
if (empty($params['id'])) {
|
|
|
RechargeChannelGroup::create($params);
|
|
RechargeChannelGroup::create($params);
|
|
|
} else {
|
|
} else {
|