From d721c5290d87e0a3c42c64287b5ad4bc64a3bbc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 23 Jan 2026 15:15:30 +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/Decorate.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/application/api/model/Decorate.php b/application/api/model/Decorate.php index b7d74a47..8e42bf8b 100644 --- a/application/api/model/Decorate.php +++ b/application/api/model/Decorate.php @@ -20,6 +20,8 @@ class Decorate extends Model // 定义字段类型 1头像框 2坐骑 3麦圈 6个人靓号 7房间靓号 8公会靓号 public $TypeArray = [1=>'头像框',12=>'降身卡',2=>'坐骑',9=>'聊天气泡',6=>'个人靓号',7=>'房间靓号',8=>'公会靓号',3=>'麦圈',10=>'CP特效',11=>'CP装扮',13=>"房间热度卡"]; protected $FromType = [1=>'购买',2=>'后台赠送',3=>'礼盒开奖',4=>'好友赠送',5=>'首充赠送',6=>'天降好礼获得',7=>'财富等级特权赠送',8=>'新人充值好礼',9=>'爵位购买赠送',10=>'任务奖励',11=>"每日签到"]; + //特殊装扮(卡片类型 可直接购买 不用配置天数价格) + public $SpecialType = [12=>'降身卡',13=>'房间热度卡']; public function __construct($data = []) { parent::__construct($data); @@ -82,7 +84,7 @@ class Decorate extends Model 'a.type' => $type, ]; } - if(in_array($type, [12,13])){ + if(in_array($type, array_keys($this->SpecialType))){ $map = [ 'type' => $type, 'delete_time' => 0, @@ -119,7 +121,7 @@ class Decorate extends Model if (!$decorate) { return ['code' => 0, 'msg' => '参数错误']; } - if(in_array($decorate['type'], [12,13])){ + if(in_array($decorate['type'], array_keys($this->SpecialType))){ $result['title'] = $decorate['title']; $result['price'] = (int)$decorate['price']; $result['base_image'] = localpath_to_netpath($decorate['base_image']); @@ -154,7 +156,7 @@ class Decorate extends Model * */ public function pay_decorate($uid, $did, $day=0,$from_type=1,$give_uid=0,$log_remark="",$num=1){ - if(empty($day) && in_array($from_type,[12,13])){ + if(empty($day) && in_array($from_type,array_keys($this->SpecialType))){ $day = 0; }else{ $day = db::name('vs_decorate_price')->where(['did'=>$did])->order('day asc')->value('day'); @@ -176,7 +178,7 @@ class Decorate extends Model if(!$decorate_info){ return ['code' => 0, 'msg' => '该装扮不存在'.$did, 'data' => null]; } - if(!in_array($decorate_info['type'],[12,13])){ + if(!in_array($decorate_info['type'],array_keys($this->SpecialType))){ //该天数是否存在 $map = []; $map = [ @@ -256,7 +258,7 @@ class Decorate extends Model $data['num'] = 1; $result = db::name('vs_user_decorate')->insert($data); }else{ - if($decorate_info['type'] == 12){ + if(in_array($decorate_info['type'],array_keys($this->SpecialType))){ $result = db::name('vs_user_decorate')->where('udid', $user_decorate_data['udid'])->update([ 'is_using' => 2, 'num' => $user_decorate_data['num'] + $num,