From e2bce9f831637d4e08d94d57cfdf3935cbc9cb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 23 Jan 2026 17:36:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E7=83=AD=E5=BA=A6=E5=8D=A1?= =?UTF-8?q?=E5=BC=80=E5=8F=91-=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Gift.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/application/api/model/Gift.php b/application/api/model/Gift.php index 50bd2561..7165c009 100644 --- a/application/api/model/Gift.php +++ b/application/api/model/Gift.php @@ -21,10 +21,6 @@ class Gift extends Model public function get_gift_label($no_label = []) { $giftType = []; - //增加房间热度卡 - if(!in_array(1013,$no_label)){ - $giftType[] = ['id' => 1013, 'name' => '房间热度卡']; - } //礼物 $giftTypeData = db::name('vs_gift_label') ->where('delete_time',0) @@ -36,6 +32,14 @@ class Gift extends Model $giftType[$key]['id'] = $value['id']; $giftType[$key]['name'] = $value['name']; } + //增加房间热度卡 + if(!in_array(1013,$no_label)){ + $giftType[] = ['id' => 1013, 'name' => '房间热度卡']; + } + //排序 1013排到最前面去 + usort($giftType, function($a, $b) { + return $a['id'] <=> $b['id']; + }); return ['code' => 1, 'msg' => '获取成功', 'data' => $giftType]; }