From d64b5057d117e6b9b79526d213a11e4e8328af83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 11 Mar 2021 18:32:52 +0800 Subject: [PATCH] Update Config.php --- app/data/controller/api/auth/Config.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/data/controller/api/auth/Config.php b/app/data/controller/api/auth/Config.php index 53241d3ef..6058d2407 100644 --- a/app/data/controller/api/auth/Config.php +++ b/app/data/controller/api/auth/Config.php @@ -21,14 +21,8 @@ class Config extends Auth public function getPayment() { $types = []; - foreach (PaymentService::TYPES as $type => $arr) { - if (isset($arr['bind']) && in_array($this->type, $arr['bind'])) { - $types[] = $type; - } - } - $map = ['status' => 1, 'deleted' => 0]; - $query = $this->app->db->name('ShopPayment')->where($map)->whereIn('type', $types); - $collect = $query->order('sort desc,id desc')->field('type,code,name')->select(); - $this->success('获取支付参数数据', $collect->toArray()); + foreach (PaymentService::TYPES as $type => $arr) if (in_array($this->type, $arr['bind'])) $types[] = $type; + $query = $this->app->db->name('ShopPayment')->where(['status' => 1, 'deleted' => 0])->whereIn('type', $types); + $this->success('获取支付参数数据', $query->order('sort desc,id desc')->field('type,code,name')->select()->toArray()); } } \ No newline at end of file