From 217c8d21ea0f89691816d878ae38165b821e8b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 12 Dec 2025 18:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4-=E6=B5=8B=E8=AF=95-bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Gift.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/api/model/Gift.php b/application/api/model/Gift.php index fc0959e5..43cafe21 100644 --- a/application/api/model/Gift.php +++ b/application/api/model/Gift.php @@ -86,7 +86,9 @@ class Gift extends Model } //获取配置里面的CP礼物 $cp_gift_ids = explode(',', get_system_config_value('cp_gift_id')); + $teacher_gift_ids = explode(',', get_system_config_value('master_special_gift')); $cp_gift = []; + $teacher_gift = []; foreach ($list as $key =>&$v) { $v['is_lock'] = $is_lock; if (in_array($v['gift_id'], $cp_gift_ids)) { @@ -96,11 +98,21 @@ class Gift extends Model }else{ $v['is_cp'] = 0; } + if (in_array($v['gift_id'], $teacher_gift_ids)) { + $v['is_teacher'] = 1; + $teacher_gift[] = $v; + unset($list[$key]); + }else{ + $v['is_teacher'] = 0; + } } //如果有CP礼物 则放在最前面 if ($cp_gift) { array_unshift($list, ...$cp_gift); } + if ($teacher_gift) { + array_unshift($list, ...$teacher_gift); + } return ['code' => 1, 'msg' => '获取成功', 'data' => $list]; } }