任务功能提交-测试-bug修改
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user