diff --git a/application/api/model/Gift.php b/application/api/model/Gift.php index 7165c009..a6f59335 100644 --- a/application/api/model/Gift.php +++ b/application/api/model/Gift.php @@ -31,14 +31,15 @@ class Gift extends Model foreach ($giftTypeData as $key => $value) { $giftType[$key]['id'] = $value['id']; $giftType[$key]['name'] = $value['name']; + $giftType[$key]['sort'] = $value['sort']; } //增加房间热度卡 if(!in_array(1013,$no_label)){ - $giftType[] = ['id' => 1013, 'name' => '房间热度卡']; + $giftType[] = ['id' => 1013, 'name' => '房间热度卡', 'sort' => 0]; } //排序 1013排到最前面去 usort($giftType, function($a, $b) { - return $a['id'] <=> $b['id']; + return $a['sort'] <=> $b['sort']; }); return ['code' => 1, 'msg' => '获取成功', 'data' => $giftType]; }